diff --git a/c++/h5/CMakeLists.txt b/c++/h5/CMakeLists.txt index 7ba8404f..2832f0d0 100644 --- a/c++/h5/CMakeLists.txt +++ b/c++/h5/CMakeLists.txt @@ -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) diff --git a/c++/h5/object.hpp b/c++/h5/object.hpp index 799eb4a6..9f2330d7 100644 --- a/c++/h5/object.hpp +++ b/c++/h5/object.hpp @@ -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; // A complex compound type consisting of two doubles