Skip to content
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

Fix H5F_LIBVER_LATEST, map lib 1.15 to H5F_LIBVER_V116 #1145

Merged
merged 3 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
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
12 changes: 11 additions & 1 deletion src/api/helpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@
# For instance, many property getters return values through pointer output arguments,
# so the methods here handle making the appropriate `Ref`s and return them (as tuples).

const H5F_LIBVER_LATEST = _libhdf5_build_ver >= v"1.12" ? H5F_LIBVER_V112 : H5F_LIBVER_V110
const H5F_LIBVER_LATEST = if _libhdf5_build_ver >= v"1.15"
H5F_LIBVER_V116
elseif _libhdf5_build_ver >= v"1.14"
H5F_LIBVER_V114
elseif _libhdf5_build_ver >= v"1.12"
H5F_LIBVER_V112
elseif _libhdf5_build_ver >= v"1.10"
H5F_LIBVER_V110
else
H5F_LIBVER_V108
end

###
### HDF5 General library functions
Expand Down
4 changes: 2 additions & 2 deletions src/properties.jl
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ end
libver_bound_to_enum(val::Integer) = val
libver_bound_to_enum(val::API.H5F_libver_t) = val
function libver_bound_to_enum(val::VersionNumber)
val >= v"1.16" ? API.H5F_LIBVER_V116 :
val >= v"1.15" ? API.H5F_LIBVER_V116 :
val >= v"1.14" ? API.H5F_LIBVER_V114 :
val >= v"1.12" ? API.H5F_LIBVER_V112 :
val >= v"1.10" ? API.H5F_LIBVER_V110 :
Expand All @@ -711,7 +711,7 @@ function libver_bound_to_enum(val::VersionNumber)
end
function libver_bound_to_enum(val::Symbol)
val == :earliest ? API.H5F_LIBVER_EARLIEST :
val == :latest ? libver_bound_to_enum(libversion) :
val == :latest ? API.H5F_LIBVER_LATEST :
throw(ArgumentError("Invalid libver_bound $val."))
end
function libver_bound_from_enum(enum::API.H5F_libver_t)
Expand Down
3 changes: 2 additions & 1 deletion test/properties.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ using Test
@test fapl.driver == Drivers.POSIX()
@test_throws HDF5.API.H5Error fapl.driver_info
@test fapl.fclose_degree == :strong
@test fapl.libver_bounds == (:earliest, Base.thisminor(HDF5.libversion))
@test fapl.libver_bounds ==
(:earliest, HDF5.libver_bound_from_enum(HDF5.API.H5F_LIBVER_LATEST))
@test fapl.meta_block_size == 1024

@test gcpl.local_heap_size_hint == 0
Expand Down
Loading