Skip to content

Update GMT constant GMT_STR16 to GMT_VF_LEN for GMT API change in 6.1.0 #397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pygmt/clib/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,12 @@ def open_virtual_file(self, family, geometry, direction, data):
valid_modifiers=["GMT_IS_REFERENCE", "GMT_IS_DUPLICATE"],
)

buff = ctp.create_string_buffer(self["GMT_STR16"])
# The core GMT changes GMT_STR16 to GMT_VF_LEN in 6.1.0
# See https://github.com/GenericMappingTools/gmt/pull/2861
if Version(self.info["version"]) < Version("6.1.0"):
buff = ctp.create_string_buffer(self["GMT_STR16"])
else:
buff = ctp.create_string_buffer(self["GMT_VF_LEN"])

status = c_open_virtualfile(
self.session_pointer, family_int, geometry_int, direction_int, data, buff
Expand Down