diff main/fixed/src/ov-fixed-complex.cc @ 11278:2deb6b24d293 octave-forge

Use HAVE_HDF5_18 macro to account for HDF5 API changes
author jordigh
date Fri, 30 Nov 2012 20:13:45 +0000
parents 58d36e8880db
children
line wrap: on
line diff
--- a/main/fixed/src/ov-fixed-complex.cc	Fri Nov 30 20:11:09 2012 +0000
+++ b/main/fixed/src/ov-fixed-complex.cc	Fri Nov 30 20:13:45 2012 +0000
@@ -349,7 +349,13 @@
 				 bool save_as_floats)
 {
   hid_t group_hid = -1;
+
+#if HAVE_HDF5_18
   group_hid = H5Gcreate (loc_id, name, 0, H5P_DEFAULT, H5P_DEFAULT);
+#else
+  group_hid = H5Gcreate (loc_id, name, 0);
+#endif
+
   if (group_hid < 0 ) return false;
 
   hsize_t dims[3];
@@ -371,8 +377,13 @@
       return false;
     }
 
+#if HAVE_HDF5_18
   data_hid = H5Dcreate (group_hid, "int", type_hid, space_hid, H5P_DEFAULT,
                         H5P_DEFAULT, H5P_DEFAULT);
+#else
+  data_hid = H5Dcreate (group_hid, "int", type_hid, space_hid, H5P_DEFAULT);
+#endif
+
   if (data_hid < 0) 
     {
       H5Sclose (space_hid);
@@ -396,8 +407,13 @@
       return false;
     }    
 
+#if HAVE_HDF5_18
   data_hid = H5Dcreate (group_hid, "dec", type_hid, space_hid, H5P_DEFAULT,
                         H5P_DEFAULT, H5P_DEFAULT);
+#else
+  data_hid = H5Dcreate (group_hid, "dec", type_hid, space_hid, H5P_DEFAULT);
+#endif
+
   if (data_hid < 0) 
     {
       H5Sclose (space_hid);
@@ -429,8 +445,13 @@
       return false;
     }
 
+#if HAVE_HDF5_18
   data_hid = H5Dcreate (group_hid, "num", type_hid, space_hid, H5P_DEFAULT,
                         H5P_DEFAULT, H5P_DEFAULT);
+#else
+  data_hid = H5Dcreate (group_hid, "num", type_hid, space_hid, H5P_DEFAULT);
+#endif
+
   if (data_hid < 0) 
     {
       H5Sclose (space_hid);
@@ -461,12 +482,22 @@
   hid_t group_hid, data_hid, type_hid, space_id;
   hsize_t rank;
 
+#if HAVE_HDF5_18
   group_hid = H5Gopen (loc_id, name, H5P_DEFAULT);
+#else
+  group_hid = H5Gopen (loc_id, name);
+#endif
+
   if (group_hid < 0 ) return false;
 
   hid_t complex_type = hdf5_make_fixed_complex_type (H5T_NATIVE_UCHAR, 1);
 
+#if HAVE_HDF5_18
   data_hid = H5Dopen (group_hid, "int", H5P_DEFAULT);
+#else
+  data_hid = H5Dopen (group_hid, "int");
+#endif
+
   type_hid = H5Dget_type (data_hid);
 
   if (! hdf5_types_compatible (type_hid, complex_type))
@@ -502,7 +533,13 @@
 
   H5Tclose(type_hid);
   H5Dclose (data_hid);
+
+#if HAVE_HDF5_18
   data_hid = H5Dopen (group_hid, "dec", H5P_DEFAULT);
+#else
+  data_hid = H5Dopen (group_hid, "dec");
+#endif
+
   type_hid = H5Dget_type (data_hid);
 
   if (! hdf5_types_compatible (type_hid, complex_type))
@@ -542,7 +579,13 @@
 
   complex_type = hdf5_make_fixed_complex_type (H5T_NATIVE_UINT, 
 					       sizeof(unsigned int));
+
+#if HAVE_HDF5_18
   data_hid = H5Dopen (group_hid, "num", H5P_DEFAULT);
+#else
+  data_hid = H5Dopen (group_hid, "num");
+#endif
+
   type_hid = H5Dget_type (data_hid);
 
   if (! hdf5_types_compatible (type_hid, complex_type))