diff --git a/matlab/h5readatt_octave.cc b/matlab/h5readatt_octave.cc old mode 100644 new mode 100755 index 13e7632..0621109 --- a/matlab/h5readatt_octave.cc +++ b/matlab/h5readatt_octave.cc @@ -2,6 +2,18 @@ #include #include "hdf5.h" +// this special treatment is necessary because Win32-Octave ships with a very old hdf5 version (1.6.10) +void CloseH5Object(hid_t obj) +{ +#if ((H5_VERS_MAJOR == 1) && (H5_VERS_MINOR == 6)) + // try group close, than Dataset close + if (H5Gclose(obj)<0) + H5Dclose(obj); +#else + H5Oclose(obj); +#endif +} + DEFUN_DLD (h5readatt_octave, args, nargout, "h5readatt_octave(,,)") { octave_value retval; @@ -27,7 +39,7 @@ DEFUN_DLD (h5readatt_octave, args, nargout, "h5readatt_octave(,,,,,,,,