summaryrefslogtreecommitdiffstats
path: root/tools/perform/sio_standalone.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perform/sio_standalone.h')
-rw-r--r--tools/perform/sio_standalone.h37
1 files changed, 31 insertions, 6 deletions
diff --git a/tools/perform/sio_standalone.h b/tools/perform/sio_standalone.h
index 8f52eba..ea9dc26 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)
@@ -210,11 +230,11 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#define HDgetgrgid(G) getgrgid(G)
#define HDgetgrnam(S) getgrnam(S)
#define HDgetgroups(Z,G) getgroups(Z,G)
-#ifdef H5_HAVE_VISUAL_STUDIO
+#ifdef H5_HAVE_WIN32_API
#define HDgetlogin() Wgetlogin()
-#else /* H5_HAVE_VISUAL_STUDIO */
+#else /* H5_HAVE_WIN32_API */
#define HDgetlogin() getlogin()
-#endif /* H5_HAVE_VISUAL_STUDIO */
+#endif /* H5_HAVE_WIN32_API */
#define HDgetpgrp() getpgrp()
#define HDgetpid() getpid()
#define HDgetppid() getppid()
@@ -222,12 +242,12 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#define HDgetpwuid(U) getpwuid(U)
#define HDgetrusage(X,S) getrusage(X,S)
#define HDgets(S) gets(S)
-#ifdef H5_HAVE_VISUAL_STUDIO
+#ifdef H5_HAVE_WIN32_API
H5_DLL int Wgettimeofday(struct timeval *tv, struct timezone *tz);
#define HDgettimeofday(V,Z) Wgettimeofday(V,Z)
-#else /* H5_HAVE_VISUAL_STUDIO */
+#else /* H5_HAVE_WIN32_API */
#define HDgettimeofday(S,P) gettimeofday(S,P)
-#endif /* H5_HAVE_VISUAL_STUDIO */
+#endif /* H5_HAVE_WIN32_API */
#define HDgetuid() getuid()
#define HDgmtime(T) gmtime(T)
#define HDisalnum(C) isalnum((int)(C)) /*cast for solaris warning*/
@@ -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)