summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2011-03-02 20:44:44 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2011-03-02 20:44:44 (GMT)
commita0f4d6d40c2679879291a44de62a7117e3d03a81 (patch)
tree50ad2a220432bbe7de8dd04f241be5c9448414cf /src
parentf62a87c45b1e01a424a37e0f1d8f8f1907c92aa1 (diff)
downloadhdf5-a0f4d6d40c2679879291a44de62a7117e3d03a81.zip
hdf5-a0f4d6d40c2679879291a44de62a7117e3d03a81.tar.gz
hdf5-a0f4d6d40c2679879291a44de62a7117e3d03a81.tar.bz2
[svn-r20180] I added 2 public macros to the H5public.h - H5_VERSION_GE and H5_VERSION_LE - and put some test cases in tfile.c.
Tested on jam, heiwa, and amani.
Diffstat (limited to 'src')
-rw-r--r--src/H5public.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/H5public.h b/src/H5public.h
index 1f835f7..0a3b072 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -83,6 +83,17 @@ extern "C" {
#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \
H5_VERS_RELEASE)
+/* macros for comparing the version */
+#define H5_VERSION_GE(Maj,Min,Rel) \
+ (((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR==Min) && (H5_VERS_RELEASE>=Rel)) || \
+ ((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR>Min)) || \
+ (H5_VERS_MAJOR>Maj))
+
+#define H5_VERSION_LE(Maj,Min,Rel) \
+ (((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR==Min) && (H5_VERS_RELEASE<=Rel)) || \
+ ((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR<Min)) || \
+ (H5_VERS_MAJOR<Maj))
+
/*
* Status return values. Failed integer functions in HDF5 result almost
* always in a negative value (unsigned failing functions sometimes return