mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-12-27 08:49:16 +08:00
Merge pull request #2888 from derobins/1_10_api_fix
Fix for H5Literate() callback versioning
This commit is contained in:
commit
0f7558c7d5
@ -45,21 +45,23 @@ with the H5Lvisit function call
|
|||||||
*/
|
*/
|
||||||
herr_t
|
herr_t
|
||||||
op_func (hid_t g_id, const char *name,
|
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,
|
const H5L_info_t *info,
|
||||||
#endif
|
|
||||||
void *op_data)
|
void *op_data)
|
||||||
{
|
{
|
||||||
hid_t id;
|
hid_t id;
|
||||||
H5I_type_t obj_type;
|
H5I_type_t obj_type;
|
||||||
|
|
||||||
strcpy((char *)op_data, name);
|
strcpy((char *)op_data, name);
|
||||||
#if H5_VERSION_GE(1,12,0)
|
#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)
|
||||||
if ((id = H5Oopen_by_token(g_id, info->u.token)) < 0) ERR;
|
/* This library is either 1.10.11 (the last 1.10 release) or earlier
|
||||||
#else
|
* 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;
|
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
|
#endif
|
||||||
|
|
||||||
/* Using H5Ovisit is really slow. Use H5Iget_type for a fast
|
/* Using H5Ovisit is really slow. Use H5Iget_type for a fast
|
||||||
|
Loading…
Reference in New Issue
Block a user