diff --git a/h5_test/tst_h_files4.c b/h5_test/tst_h_files4.c index 3e82f352e..0d61fdea8 100644 --- a/h5_test/tst_h_files4.c +++ b/h5_test/tst_h_files4.c @@ -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