Made memory free method conditional, based on if H5free_memory is available in libhdf5 or not. In support of code contributed by Greg Sjaardema . See for more information.
*/
#include "h5_err_macros.h"
#include <hdf5.h>
+#include "config.h"
#define FILE_NAME "tst_h_enums.h5"
#define DIM1_LEN 12
@@ -120,7 +121,11 @@ main()
if (the_value != val[i]) ERR;
member_name = H5Tget_member_name(typeid, i);
if (strcmp(member_name, love_how[i])) ERR;
+#ifdef HDF5_HAS_H5FREE
H5free_memory(member_name);
+#else
+ free(member_name);
+#endif
}
/* Now read the data in the attribute and make sure it's what we
@@ -234,7 +239,11 @@ main()
if (the_value != val[i]) ERR;
member_name = H5Tget_member_name(typeid, i);
if (strcmp(member_name, lang[i])) ERR;
+#ifdef HDF5_HAS_H5FREE
H5free_memory(member_name);
+#else
+ free(member_name);
+#endif
}
/* Now read the data in the dataset and make sure it's what we
