Changeset 1755


Ignore:
Timestamp:
15/11/11 12:41:59 (6 months ago)
Author:
Freddie Akeroyd
Message:

Add in explict checks for HDF5 >= 1.8.0 Refs #303

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/napi5.c

    r1741 r1755  
    3333#include "napi.h" 
    3434#include "napi5.h" 
     35 
     36#if !H5_VERSION_GE(1,8,0) 
     37#error HDF5 Version must be 1.8.0 or higher 
     38#endif 
    3539 
    3640#define NX_UNKNOWN_GROUP "" /* for when no NX_class attr */ 
     
    153157  size_t rdcc_nbytes; 
    154158  double rdcc_w0; 
     159  unsigned hdf5_majnum, hdf5_minnum, hdf5_relnum; 
     160 
     161  *pHandle = NULL; 
     162 
     163  if (H5get_libversion(&hdf5_majnum, &hdf5_minnum, &hdf5_relnum) < 0) 
     164  { 
     165      NXReportError("ERROR: cannot determine HDF5 library version"); 
     166      return NX_ERROR; 
     167  } 
     168  if (hdf5_majnum == 1 && hdf5_minnum < 8) 
     169  { 
     170      NXReportError("ERROR: HDF5 library 1.8.0 or higher required"); 
     171      return NX_ERROR; 
     172  } 
    155173 
    156174  /* mask of any options for now */ 
     
    163181#endif  
    164182 
    165     *pHandle = NULL; 
    166183 
    167184    pNew = (pNexusFile5) malloc (sizeof (NexusFile5)); 
Note: See TracChangeset for help on using the changeset viewer.