Skip to content

Commit

Permalink
Fix hsize_t for hdf5 versions >=1.13
Browse files Browse the repository at this point in the history
  • Loading branch information
Wentzell committed Feb 10, 2023
1 parent 18e9627 commit d9af4b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions c++/h5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ target_compile_options(hdf5 INTERFACE ${HDF5_DEFINITIONS})
if(HDF5_VERSION VERSION_GREATER 1.10)
target_compile_definitions(hdf5 INTERFACE H5_USE_110_API)
endif()
if(HDF5_VERSION VERSION_GREATER_EQUAL 1.13)
target_compile_definitions(hdf5 INTERFACE H5_VER_GE_113)
endif()

# Link against interface target and export
target_link_libraries(h5_c PRIVATE hdf5)
Expand Down
7 changes: 6 additions & 1 deletion c++/h5/object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ namespace h5 {
// Hence complex installation paths to hdf5 are only needed in the cpp file,
// not by the users of the library.
using hid_t = int64_t;
using hsize_t = unsigned long long;
using hsize_t =
#ifdef H5_VER_GE_113
uint64_t;
#else
unsigned long long;
#endif
using v_t = std::vector<hsize_t>;

// A complex compound type consisting of two doubles
Expand Down

0 comments on commit d9af4b5

Please sign in to comment.