Skip to content

Commit 3dcafdd

Browse files
committed
Fix compilation error due to API change in HDF5 v1.12
HDF5 v1.12 changed the signature of H5Ovisit_by_name. Using the new API is actually more efficient, since we can avoid retrieving fields that aren't needed for the visitor function. I'm also checking H5_USE_110_API so that anyone explicitly opting for the old API won't be affected by this change.
1 parent 8dc3f2a commit 3dcafdd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cxx/isce3/io/IH5.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,15 @@ std::vector<std::string> findByName(hid_t loc_id, std::string nameIn,
108108
findMetaInfo.basePath.append("/");
109109
}
110110

111+
// If we are using the new H5Ovisit_by_name API introduced in HDF5 1.12:
112+
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API)
113+
// we do a more efficient visit, only retrieving the basic info
114+
H5Ovisit_by_name3(loc_id, start.c_str(), H5_INDEX_NAME, H5_ITER_INC,
115+
matchName, &findMetaInfo, H5O_INFO_BASIC, H5P_DEFAULT);
116+
#else
111117
H5Ovisit_by_name(loc_id, start.c_str(), H5_INDEX_NAME, H5_ITER_INC,
112118
matchName, &findMetaInfo, H5P_DEFAULT);
119+
#endif
113120

114121
return findMetaInfo.outList;
115122
}

0 commit comments

Comments
 (0)