summaryrefslogtreecommitdiffstats
path: root/tools/perform
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2016-10-03 22:07:21 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2016-10-03 22:07:21 (GMT)
commitec991ed4b813adb3300bc82ed64c550eb505e3d0 (patch)
treed6c7b427ee9a3b4e5babc64d4689b9d394abc3b8 /tools/perform
parent9fd74f83e656be95ef456d4fa275a598153a6e61 (diff)
downloadhdf5-ec991ed4b813adb3300bc82ed64c550eb505e3d0.zip
hdf5-ec991ed4b813adb3300bc82ed64c550eb505e3d0.tar.gz
hdf5-ec991ed4b813adb3300bc82ed64c550eb505e3d0.tar.bz2
Fix missing defines for standalone perf
Diffstat (limited to 'tools/perform')
-rw-r--r--tools/perform/sio_standalone.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/perform/sio_standalone.h b/tools/perform/sio_standalone.h
index 258eafb..63dc7b0 100644
--- a/tools/perform/sio_standalone.h
+++ b/tools/perform/sio_standalone.h
@@ -56,6 +56,14 @@
# define H5_INC_ENUM(TYPE,VAR) (VAR)=((TYPE)((VAR)+1))
#endif
+#define H5_FLT_ABS_EQUAL(X,Y) (HDfabsf((X)-(Y)) < FLT_EPSILON)
+#define H5_DBL_ABS_EQUAL(X,Y) (HDfabs ((X)-(Y)) < DBL_EPSILON)
+#define H5_LDBL_ABS_EQUAL(X,Y) (HDfabsl((X)-(Y)) < LDBL_EPSILON)
+
+#define H5_FLT_REL_EQUAL(X,Y,M) (HDfabsf(((Y)-(X)) / (X)) < (M))
+#define H5_DBL_REL_EQUAL(X,Y,M) (HDfabs (((Y)-(X)) / (X)) < (M))
+#define H5_LDBL_REL_EQUAL(X,Y,M) (HDfabsl(((Y)-(X)) / (X)) < (M))
+
/*
* Redefine all the POSIX functions. We should never see a POSIX
* function (or any other non-HDF5 function) in the source!
@@ -183,20 +191,32 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#define HDstat(S,B) _stati64(S,B)
typedef struct _stati64 h5_stat_t;
typedef __int64 h5_stat_size_t;
+ #define HDoff_t __int64
#elif H5_SIZEOF_OFF_T!=8 && H5_SIZEOF_OFF64_T==8 && defined(H5_HAVE_STAT64)
#define HDfstat(F,B) fstat64(F,B)
#define HDlstat(S,B) lstat64(S,B)
#define HDstat(S,B) stat64(S,B)
typedef struct stat64 h5_stat_t;
typedef off64_t h5_stat_size_t;
+ #define HDoff_t off64_t
#else
#define HDfstat(F,B) fstat(F,B)
#define HDlstat(S,B) lstat(S,B)
#define HDstat(S,B) stat(S,B)
typedef struct stat h5_stat_t;
typedef off_t h5_stat_size_t;
+ #define HDoff_t off_t
#endif
+#ifndef H5_HAVE_WIN32_API
+/* These definitions differ in Windows and are defined in
+ * H5win32defs for that platform.
+ */
+typedef struct stat h5_stat_t;
+typedef off_t h5_stat_size_t;
+#define HDoff_t off_t
+#endif /* H5_HAVE_WIN32_API */
+
#define HDftell(F) ftell(F)
#define HDftruncate(F,L) ftruncate(F,L)
#define HDfwrite(M,Z,N,F) fwrite(M,Z,N,F)
@@ -402,6 +422,11 @@ H5_DLL void HDsrand(unsigned int seed);
#define HDstrtol(S,R,N) strtol(S,R,N)
H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base);
#define HDstrtoul(S,R,N) strtoul(S,R,N)
+#ifdef H5_HAVE_WIN32_API
+#define HDstrtoull(S,R,N) _strtoui64(S,R,N)
+#else
+#define HDstrtoull(S,R,N) strtoull(S,R,N)
+#endif
#define HDstrxfrm(X,Y,Z) strxfrm(X,Y,Z)
#define HDsysconf(N) sysconf(N)
#define HDsystem(S) system(S)