Skip to content

Commit

Permalink
Merge pull request #2888 from derobins/1_10_api_fix
Browse files Browse the repository at this point in the history
Fix for H5Literate() callback versioning
  • Loading branch information
WardF authored Mar 14, 2024
2 parents b90e884 + c9bbf8f commit 0f7558c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions h5_test/tst_h_files4.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,23 @@ with the H5Lvisit function call
*/
herr_t
op_func (hid_t g_id, const char *name,
#if H5_VERSION_GE(1,12,0)
const H5L_info2_t *info,
#else
const H5L_info_t *info,
#endif
void *op_data)
{
hid_t id;
H5I_type_t obj_type;

strcpy((char *)op_data, name);
#if H5_VERSION_GE(1,12,0)
if ((id = H5Oopen_by_token(g_id, info->u.token)) < 0) ERR;
#else
#if H5_VERSION_LE(1, 10, 11) || defined(H5_USE_110_API_DEFAULT) || defined(H5_USE_18_API_DEFAULT) || defined(H5_USE_16_API_DEFAULT)
/* This library is either 1.10.11 (the last 1.10 release) or earlier
* OR this is a later version of the library built with a 1.10 or
* earlier API (earlier versions did not define their own USE
* API symbol).
*/
if ((id = H5Oopen_by_addr(g_id, info->u.address)) < 0) ERR;
#else
/* HDF5 1.12 switched from addresses to tokens to better support the VOL */
if ((id = H5Oopen_by_token(g_id, info->u.token)) < 0) ERR;
#endif

/* Using H5Ovisit is really slow. Use H5Iget_type for a fast
Expand Down

0 comments on commit 0f7558c

Please sign in to comment.