Skip to content

Commit

Permalink
Merge pull request OSGeo#6660 from rouault/fix_6657
Browse files Browse the repository at this point in the history
HDF5: fix build with libhdf5 1.13.2 and 1.13.3 (fixes OSGeo#6657)
(cherry picked from commit f7543e6)
  • Loading branch information
rouault authored and mpdaly committed Jan 8, 2024
1 parent 04d4088 commit 73cd128
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions frmts/hdf5/hdf5vfl.h
Expand Up @@ -46,6 +46,13 @@
#define HDF5_1_13_OR_LATER
#endif

// HDF5 >= 1.13.2
#ifdef H5FD_CLASS_VERSION
# if H5FD_CLASS_VERSION != 1
# error "HDF5_vsil_g needs to be adapted to the new layout of H5FD_class_t. Look at ${hdf5_prefix}/include/H5FDdevelop.h"
# endif
#endif

static std::mutex gMutex;
static hid_t hFileDriver = -1;

Expand Down Expand Up @@ -73,6 +80,9 @@ static void HDF5VFLUnloadFileDriver();

/* See https://support.hdfgroup.org/HDF5/doc/TechNotes/VFL.html */
static const H5FD_class_t HDF5_vsil_g = {
#ifdef H5FD_CLASS_VERSION
H5FD_CLASS_VERSION,
#endif
#ifdef HDF5_1_13_OR_LATER
/* value: 513 has been reserved with hdfgroup and is registered at:
* https://portal.hdfgroup.org/pages/viewpage.action?pageId=74188097 */
Expand Down Expand Up @@ -107,6 +117,12 @@ static const H5FD_class_t HDF5_vsil_g = {
nullptr, /* get_handle */
HDF5_vsil_read, /* read */
HDF5_vsil_write, /* write */
#if H5FD_CLASS_VERSION == 1
nullptr, /* read_vector */
nullptr, /* write_vector */
nullptr, /* read_selection */
nullptr, /* write_selection */
#endif
nullptr, /* flush */
HDF5_vsil_truncate, /* truncate */
nullptr, /* lock */
Expand Down

0 comments on commit 73cd128

Please sign in to comment.