summaryrefslogtreecommitdiffstats
path: root/perform
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2011-09-12 14:02:44 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2011-09-12 14:02:44 (GMT)
commit9115bab9e36d72bb395820e38b6bee4c99dcd78c (patch)
tree2fa4450bca7e33a1466fa2be8afb59a9370b8b64 /perform
parentee039a03b9fca394251bd1b543df3aa819b13d51 (diff)
downloadhdf5-9115bab9e36d72bb395820e38b6bee4c99dcd78c.zip
hdf5-9115bab9e36d72bb395820e38b6bee4c99dcd78c.tar.gz
hdf5-9115bab9e36d72bb395820e38b6bee4c99dcd78c.tar.bz2
[svn-r21376] JIRA-HDFFV-2748: Relplace WIN32 macros in source. New H5_HAVE_WIN32_API and H5_HAVE_VISUAL_STUDIO defines only need to be set on windows. Autotools configure is not affected.
Trunk passed for a week and cmake branch has been in place > 3 weeks. Tested: local linux
Diffstat (limited to 'perform')
-rw-r--r--perform/benchpar.c5
-rw-r--r--perform/iopipe.c306
-rw-r--r--perform/pio_perf.h2
-rw-r--r--perform/pio_standalone.h56
-rw-r--r--perform/sio_standalone.h48
5 files changed, 213 insertions, 204 deletions
diff --git a/perform/benchpar.c b/perform/benchpar.c
index bf75d77..24146e4 100644
--- a/perform/benchpar.c
+++ b/perform/benchpar.c
@@ -25,6 +25,11 @@
#include "hdf5.h"
/* Local macros */
+#ifdef H5_HAVE_VISUAL_STUDIO
+#define HDgetlogin() Wgetlogin()
+#else /* H5_HAVE_VISUAL_STUDIO */
+#define HDgetlogin() getlogin()
+#endif /* H5_HAVE_VISUAL_STUDIO */
/*
* HDF Boolean type.
diff --git a/perform/iopipe.c b/perform/iopipe.c
index c72e3aa..85063fa 100644
--- a/perform/iopipe.c
+++ b/perform/iopipe.c
@@ -28,34 +28,34 @@
#endif
-#define RAW_FILE_NAME "iopipe.raw"
-#define HDF5_FILE_NAME "iopipe.h5"
-#define HEADING "%-16s"
-#define PROGRESS '='
+#define RAW_FILE_NAME "iopipe.raw"
+#define HDF5_FILE_NAME "iopipe.h5"
+#define HEADING "%-16s"
+#define PROGRESS '='
#if 0
/* Normal testing */
-#define REQUEST_SIZE_X 4579
-#define REQUEST_SIZE_Y 4579
-#define NREAD_REQUESTS 45
-#define NWRITE_REQUESTS 45
+#define REQUEST_SIZE_X 4579
+#define REQUEST_SIZE_Y 4579
+#define NREAD_REQUESTS 45
+#define NWRITE_REQUESTS 45
#else
/* Speedy testing */
-#define REQUEST_SIZE_X 1000
-#define REQUEST_SIZE_Y 1000
-#define NREAD_REQUESTS 45
-#define NWRITE_REQUESTS 45
+#define REQUEST_SIZE_X 1000
+#define REQUEST_SIZE_Y 1000
+#define NREAD_REQUESTS 45
+#define NWRITE_REQUESTS 45
#endif
/*-------------------------------------------------------------------------
- * Function: print_stats
+ * Function: print_stats
*
- * Purpose: Prints statistics
+ * Purpose: Prints statistics
*
- * Return: void
+ * Return: void
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, March 12, 1998
*
* Modifications:
@@ -65,63 +65,63 @@
#ifdef H5_HAVE_GETRUSAGE
static void
print_stats (const char *prefix,
- struct rusage *r_start, struct rusage *r_stop,
- struct timeval *t_start, struct timeval *t_stop,
- size_t nbytes)
+ struct rusage *r_start, struct rusage *r_stop,
+ struct timeval *t_start, struct timeval *t_stop,
+ size_t nbytes)
#else /* H5_HAVE_GETRUSAGE */
static void
print_stats (const char *prefix,
- struct timeval *r_start, struct timeval *r_stop,
- struct timeval *t_start, struct timeval *t_stop,
- size_t nbytes)
+ struct timeval *r_start, struct timeval *r_stop,
+ struct timeval *t_start, struct timeval *t_stop,
+ size_t nbytes)
#endif /* H5_HAVE_GETRUSAGE */
{
- double e_time, bw;
+ double e_time, bw;
#ifdef H5_HAVE_GETRUSAGE
- double u_time, s_time;
+ double u_time, s_time;
u_time = ((double)(r_stop->ru_utime.tv_sec)+
- (double)(r_stop->ru_utime.tv_usec)/1000000.0) -
- ((double)(r_start->ru_utime.tv_sec)+
- (double)(r_start->ru_utime.tv_usec)/1000000.0);
+ (double)(r_stop->ru_utime.tv_usec)/1000000.0) -
+ ((double)(r_start->ru_utime.tv_sec)+
+ (double)(r_start->ru_utime.tv_usec)/1000000.0);
s_time = ((double)(r_stop->ru_stime.tv_sec)+
- (double)(r_stop->ru_stime.tv_usec)/1000000.0) -
- ((double)(r_start->ru_stime.tv_sec)+
- (double)(r_start->ru_stime.tv_usec)/1000000.0);
+ (double)(r_stop->ru_stime.tv_usec)/1000000.0) -
+ ((double)(r_start->ru_stime.tv_sec)+
+ (double)(r_start->ru_stime.tv_usec)/1000000.0);
#endif
#ifndef H5_HAVE_SYS_TIMEB
e_time = ((double)(t_stop->tv_sec)+
- (double)(t_stop->tv_usec)/1000000.0) -
- ((double)(t_start->tv_sec)+
- (double)(t_start->tv_usec)/1000000.0);
+ (double)(t_stop->tv_usec)/1000000.0) -
+ ((double)(t_start->tv_sec)+
+ (double)(t_start->tv_usec)/1000000.0);
#else
e_time = ((double)(t_stop->tv_sec)+
- (double)(t_stop->tv_usec)/1000.0) -
- ((double)(t_start->tv_sec)+
- (double)(t_start->tv_usec)/1000.0);
+ (double)(t_stop->tv_usec)/1000.0) -
+ ((double)(t_start->tv_sec)+
+ (double)(t_start->tv_usec)/1000.0);
#endif
bw = (double)nbytes / e_time;
#ifdef H5_HAVE_GETRUSAGE
printf (HEADING "%1.2fuser %1.2fsystem %1.2felapsed %1.2fMB/s\n",
- prefix, u_time, s_time, e_time, bw/(1024*1024));
+ prefix, u_time, s_time, e_time, bw/(1024*1024));
#else
printf (HEADING "%1.2felapsed %1.2fMB/s\n",
- prefix, e_time, bw/(1024*1024));
+ prefix, e_time, bw/(1024*1024));
#endif
}
/*-------------------------------------------------------------------------
- * Function: synchronize
+ * Function: synchronize
*
* Purpose:
*
- * Return: void
+ * Return: void
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, March 12, 1998
*
* Modifications:
@@ -132,7 +132,7 @@ static void
synchronize (void)
{
#ifdef H5_HAVE_SYSTEM
-#if defined(_WIN32) && ! defined(__CYGWIN__)
+#if defined(H5_HAVE_WIN32_API) && ! defined(__CYGWIN__)
_flushall();
#else
HDsystem("sync");
@@ -143,15 +143,15 @@ synchronize (void)
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
* Purpose:
*
- * Return: Success:
+ * Return: Success:
*
- * Failure:
+ * Failure:
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, March 12, 1998
*
* Modifications:
@@ -161,29 +161,29 @@ synchronize (void)
int
main (void)
{
- static hsize_t size[2] = {REQUEST_SIZE_X, REQUEST_SIZE_Y};
- static unsigned nread = NREAD_REQUESTS, nwrite = NWRITE_REQUESTS;
+ static hsize_t size[2] = {REQUEST_SIZE_X, REQUEST_SIZE_Y};
+ static unsigned nread = NREAD_REQUESTS, nwrite = NWRITE_REQUESTS;
- unsigned char *the_data = NULL;
- hid_t file, dset, file_space = -1;
- herr_t status;
+ unsigned char *the_data = NULL;
+ hid_t file, dset, file_space = -1;
+ herr_t status;
#ifdef H5_HAVE_GETRUSAGE
- struct rusage r_start, r_stop;
+ struct rusage r_start, r_stop;
#else
struct timeval r_start, r_stop;
#endif
- struct timeval t_start, t_stop;
- int fd;
- unsigned u;
- hssize_t n;
- off_t offset;
- hsize_t start[2];
- hsize_t count[2];
+ struct timeval t_start, t_stop;
+ int fd;
+ unsigned u;
+ hssize_t n;
+ off_t offset;
+ hsize_t start[2];
+ hsize_t count[2];
#ifdef H5_HAVE_SYS_TIMEB
- struct _timeb *tbstart = malloc(sizeof(struct _timeb));
- struct _timeb *tbstop = malloc(sizeof(struct _timeb));
+ struct _timeb *tbstart = malloc(sizeof(struct _timeb));
+ struct _timeb *tbstop = malloc(sizeof(struct _timeb));
#endif
/*
* The extra cast in the following statement is a bug workaround for the
@@ -191,7 +191,7 @@ main (void)
* 1998-11-06 ptl
*/
printf ("I/O request size is %1.1fMB\n",
- (double)(hssize_t)(size[0]*size[1])/1024.0*1024);
+ (double)(hssize_t)(size[0]*size[1])/1024.0*1024);
/* Open the files */
file = H5Fcreate (HDF5_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -218,14 +218,14 @@ main (void)
HDgettimeofday(&t_start, NULL);
#else
#ifdef H5_HAVE_SYS_TIMEB
- _ftime(tbstart);
+ _ftime(tbstart);
#endif
#endif
fprintf (stderr, HEADING, "fill raw");
for(u = 0; u < nwrite; u++) {
- putc (PROGRESS, stderr);
- HDfflush(stderr);
- HDmemset(the_data, 0xAA, (size_t)(size[0]*size[1]));
+ putc (PROGRESS, stderr);
+ HDfflush(stderr);
+ HDmemset(the_data, 0xAA, (size_t)(size[0]*size[1]));
}
#ifdef H5_HAVE_GETRUSAGE
HDgetrusage(RUSAGE_SELF, &r_stop);
@@ -234,17 +234,17 @@ main (void)
HDgettimeofday(&t_stop, NULL);
#else
#ifdef H5_HAVE_SYS_TIMEB
- _ftime(tbstop);
- t_start.tv_sec = tbstart->time;
- t_start.tv_usec = tbstart->millitm;
- t_stop.tv_sec = tbstop->time;
- t_stop.tv_usec = tbstop->millitm;
+ _ftime(tbstop);
+ t_start.tv_sec = tbstart->time;
+ t_start.tv_usec = tbstart->millitm;
+ t_stop.tv_sec = tbstop->time;
+ t_stop.tv_usec = tbstop->millitm;
#endif
#endif
putc ('\n', stderr);
print_stats ("fill raw",
- &r_start, &r_stop, &t_start, &t_stop,
- (size_t)(nread*size[0]*size[1]));
+ &r_start, &r_stop, &t_start, &t_stop,
+ (size_t)(nread*size[0]*size[1]));
/* Fill hdf5 */
@@ -256,16 +256,16 @@ main (void)
HDgettimeofday(&t_start, NULL);
#else
#ifdef H5_HAVE_SYS_TIMEB
- _ftime(tbstart);
+ _ftime(tbstart);
#endif
#endif
fprintf (stderr, HEADING, "fill hdf5");
for(u = 0; u < nread; u++) {
- putc (PROGRESS, stderr);
- HDfflush(stderr);
- status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space,
- H5P_DEFAULT, the_data);
- assert (status>=0);
+ putc (PROGRESS, stderr);
+ HDfflush(stderr);
+ status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space,
+ H5P_DEFAULT, the_data);
+ assert (status>=0);
}
#ifdef H5_HAVE_GETRUSAGE
HDgetrusage(RUSAGE_SELF, &r_stop);
@@ -274,17 +274,17 @@ main (void)
HDgettimeofday(&t_stop, NULL);
#else
#ifdef H5_HAVE_SYS_TIMEB
- _ftime(tbstop);
- t_start.tv_sec = tbstart->time;
- t_start.tv_usec = tbstart->millitm;
- t_stop.tv_sec = tbstop->time;
- t_stop.tv_usec = tbstop->millitm;
+ _ftime(tbstop);
+ t_start.tv_sec = tbstart->time;
+ t_start.tv_usec = tbstart->millitm;
+ t_stop.tv_sec = tbstop->time;
+ t_stop.tv_usec = tbstop->millitm;
#endif
#endif
putc ('\n', stderr);
print_stats ("fill hdf5",
- &r_start, &r_stop, &t_start, &t_stop,
- (size_t)(nread*size[0]*size[1]));
+ &r_start, &r_stop, &t_start, &t_stop,
+ (size_t)(nread*size[0]*size[1]));
/* Write the raw dataset */
synchronize ();
@@ -295,17 +295,17 @@ main (void)
HDgettimeofday(&t_start, NULL);
#else
#ifdef H5_HAVE_SYS_TIMEB
- _ftime(tbstart);
+ _ftime(tbstart);
#endif
#endif
fprintf (stderr, HEADING, "out raw");
for(u = 0; u < nwrite; u++) {
- putc (PROGRESS, stderr);
- HDfflush(stderr);
- offset = HDlseek (fd, (off_t)0, SEEK_SET);
- assert (0==offset);
- n = HDwrite (fd, the_data, (size_t)(size[0]*size[1]));
- assert (n>=0 && (size_t)n==size[0]*size[1]);
+ putc (PROGRESS, stderr);
+ HDfflush(stderr);
+ offset = HDlseek (fd, (off_t)0, SEEK_SET);
+ assert (0==offset);
+ n = HDwrite (fd, the_data, (size_t)(size[0]*size[1]));
+ assert (n>=0 && (size_t)n==size[0]*size[1]);
}
#ifdef H5_HAVE_GETRUSAGE
HDgetrusage(RUSAGE_SELF, &r_stop);
@@ -314,17 +314,17 @@ main (void)
HDgettimeofday(&t_stop, NULL);
#else
#ifdef H5_HAVE_SYS_TIMEB
- _ftime(tbstop);
- t_start.tv_sec = tbstart->time;
- t_start.tv_usec = tbstart->millitm;
- t_stop.tv_sec = tbstop->time;
- t_stop.tv_usec = tbstop->millitm;
+ _ftime(tbstop);
+ t_start.tv_sec = tbstart->time;
+ t_start.tv_usec = tbstart->millitm;
+ t_stop.tv_sec = tbstop->time;
+ t_stop.tv_usec = tbstop->millitm;
#endif
#endif
putc ('\n', stderr);
print_stats ("out raw",
- &r_start, &r_stop, &t_start, &t_stop,
- (size_t)(nread*size[0]*size[1]));
+ &r_start, &r_stop, &t_start, &t_stop,
+ (size_t)(nread*size[0]*size[1]));
/* Write the hdf5 dataset */
synchronize ();
@@ -335,16 +335,16 @@ main (void)
HDgettimeofday(&t_start, NULL);
#else
#ifdef H5_HAVE_SYS_TIMEB
- _ftime(tbstart);
+ _ftime(tbstart);
#endif
#endif
fprintf (stderr, HEADING, "out hdf5");
for(u = 0; u < nwrite; u++) {
- putc (PROGRESS, stderr);
- HDfflush(stderr);
- status = H5Dwrite (dset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, the_data);
- assert (status>=0);
+ putc (PROGRESS, stderr);
+ HDfflush(stderr);
+ status = H5Dwrite (dset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, the_data);
+ assert (status>=0);
}
#ifdef H5_HAVE_GETRUSAGE
HDgetrusage(RUSAGE_SELF, &r_stop);
@@ -353,17 +353,17 @@ main (void)
HDgettimeofday(&t_stop, NULL);
#else
#ifdef H5_HAVE_SYS_TIMEB
- _ftime(tbstop);
- t_start.tv_sec = tbstart->time;
- t_start.tv_usec = tbstart->millitm;
- t_stop.tv_sec = tbstop->time;
- t_stop.tv_usec = tbstop->millitm;
+ _ftime(tbstop);
+ t_start.tv_sec = tbstart->time;
+ t_start.tv_usec = tbstart->millitm;
+ t_stop.tv_sec = tbstop->time;
+ t_stop.tv_usec = tbstop->millitm;
#endif
#endif
putc ('\n', stderr);
print_stats ("out hdf5",
- &r_start, &r_stop, &t_start, &t_stop,
- (size_t)(nread*size[0]*size[1]));
+ &r_start, &r_stop, &t_start, &t_stop,
+ (size_t)(nread*size[0]*size[1]));
/* Read the raw dataset */
synchronize ();
@@ -374,17 +374,17 @@ main (void)
HDgettimeofday(&t_start, NULL);
#else
#ifdef H5_HAVE_SYS_TIMEB
- _ftime(tbstart);
+ _ftime(tbstart);
#endif
#endif
fprintf (stderr, HEADING, "in raw");
for(u = 0; u < nread; u++) {
- putc (PROGRESS, stderr);
- HDfflush(stderr);
- offset = HDlseek (fd, (off_t)0, SEEK_SET);
- assert (0==offset);
- n = HDread (fd, the_data, (size_t)(size[0]*size[1]));
- assert (n>=0 && (size_t)n==size[0]*size[1]);
+ putc (PROGRESS, stderr);
+ HDfflush(stderr);
+ offset = HDlseek (fd, (off_t)0, SEEK_SET);
+ assert (0==offset);
+ n = HDread (fd, the_data, (size_t)(size[0]*size[1]));
+ assert (n>=0 && (size_t)n==size[0]*size[1]);
}
#ifdef H5_HAVE_GETRUSAGE
HDgetrusage(RUSAGE_SELF, &r_stop);
@@ -393,17 +393,17 @@ main (void)
HDgettimeofday(&t_stop, NULL);
#else
#ifdef H5_HAVE_SYS_TIMEB
- _ftime(tbstop);
- t_start.tv_sec = tbstart->time;
- t_start.tv_usec = tbstart->millitm;
- t_stop.tv_sec = tbstop->time;
- t_stop.tv_usec = tbstop->millitm;
+ _ftime(tbstop);
+ t_start.tv_sec = tbstart->time;
+ t_start.tv_usec = tbstart->millitm;
+ t_stop.tv_sec = tbstop->time;
+ t_stop.tv_usec = tbstop->millitm;
#endif
#endif
putc ('\n', stderr);
print_stats ("in raw",
- &r_start, &r_stop, &t_start, &t_stop,
- (size_t)(nread*size[0]*size[1]));
+ &r_start, &r_stop, &t_start, &t_stop,
+ (size_t)(nread*size[0]*size[1]));
/* Read the hdf5 dataset */
@@ -415,16 +415,16 @@ main (void)
HDgettimeofday(&t_start, NULL);
#else
#ifdef H5_HAVE_SYS_TIMEB
- _ftime(tbstart);
+ _ftime(tbstart);
#endif
#endif
fprintf (stderr, HEADING, "in hdf5");
for(u = 0; u < nread; u++) {
- putc (PROGRESS, stderr);
- HDfflush(stderr);
- status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space,
- H5P_DEFAULT, the_data);
- assert (status>=0);
+ putc (PROGRESS, stderr);
+ HDfflush(stderr);
+ status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space,
+ H5P_DEFAULT, the_data);
+ assert (status>=0);
}
#ifdef H5_HAVE_GETRUSAGE
HDgetrusage(RUSAGE_SELF, &r_stop);
@@ -433,17 +433,17 @@ main (void)
HDgettimeofday(&t_stop, NULL);
#else
#ifdef H5_HAVE_SYS_TIMEB
- _ftime(tbstop);
- t_start.tv_sec = tbstart->time;
- t_start.tv_usec = tbstart->millitm;
- t_stop.tv_sec = tbstop->time;
- t_stop.tv_usec = tbstop->millitm;
+ _ftime(tbstop);
+ t_start.tv_sec = tbstart->time;
+ t_start.tv_usec = tbstart->millitm;
+ t_stop.tv_sec = tbstop->time;
+ t_stop.tv_usec = tbstop->millitm;
#endif
#endif
putc ('\n', stderr);
print_stats ("in hdf5",
- &r_start, &r_stop, &t_start, &t_stop,
- (size_t)(nread*size[0]*size[1]));
+ &r_start, &r_stop, &t_start, &t_stop,
+ (size_t)(nread*size[0]*size[1]));
/* Read hyperslab */
assert (size[0]>20 && size[1]>20);
@@ -459,16 +459,16 @@ main (void)
HDgettimeofday(&t_start, NULL);
#else
#ifdef H5_HAVE_SYS_TIMEB
- _ftime(tbstart);
+ _ftime(tbstart);
#endif
#endif
fprintf (stderr, HEADING, "in hdf5 partial");
for(u = 0; u < nread; u++) {
- putc (PROGRESS, stderr);
- HDfflush(stderr);
- status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space,
- H5P_DEFAULT, the_data);
- assert (status>=0);
+ putc (PROGRESS, stderr);
+ HDfflush(stderr);
+ status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space,
+ H5P_DEFAULT, the_data);
+ assert (status>=0);
}
#ifdef H5_HAVE_GETRUSAGE
HDgetrusage(RUSAGE_SELF, &r_stop);
@@ -477,17 +477,17 @@ main (void)
HDgettimeofday(&t_stop, NULL);
#else
#ifdef H5_HAVE_SYS_TIMEB
- _ftime(tbstop);
- t_start.tv_sec = tbstart->time;
- t_start.tv_usec = tbstart->millitm;
- t_stop.tv_sec = tbstop->time;
- t_stop.tv_usec = tbstop->millitm;
+ _ftime(tbstop);
+ t_start.tv_sec = tbstart->time;
+ t_start.tv_usec = tbstart->millitm;
+ t_stop.tv_sec = tbstop->time;
+ t_stop.tv_usec = tbstop->millitm;
#endif
#endif
putc('\n', stderr);
print_stats("in hdf5 partial",
- &r_start, &r_stop, &t_start, &t_stop,
- (size_t)(nread*count[0]*count[1]));
+ &r_start, &r_stop, &t_start, &t_stop,
+ (size_t)(nread*count[0]*count[1]));
diff --git a/perform/pio_perf.h b/perform/pio_perf.h
index f9a8e03..6f510ca 100644
--- a/perform/pio_perf.h
+++ b/perform/pio_perf.h
@@ -16,7 +16,6 @@
#ifndef PIO_PERF_H__
#define PIO_PERF_H__
-#include "pio_timer.h"
#ifndef STANDALONE
#include "H5private.h"
#include "h5test.h"
@@ -24,6 +23,7 @@
#else
#include "pio_standalone.h"
#endif
+#include "pio_timer.h"
/* setup the dataset no fill option if this is v1.5 or more */
#if H5_VERS_MAJOR > 1 || H5_VERS_MINOR > 4
diff --git a/perform/pio_standalone.h b/perform/pio_standalone.h
index a4bc8b5..584a057 100644
--- a/perform/pio_standalone.h
+++ b/perform/pio_standalone.h
@@ -22,7 +22,7 @@
/** From H5private.h **/
-#include "H5public.h" /* Include Public Definitions */
+#include "H5public.h" /* Include Public Definitions */
/*
@@ -47,57 +47,57 @@
* And now for a couple non-Posix functions... Watch out for systems that
* define these in terms of macros.
*/
-#ifdef _WIN32
-#define HDstrdup(S) _strdup(S)
-#else /* _WIN32 */
+#ifdef H5_HAVE_WIN32_API
+#define HDstrdup(S) _strdup(S)
+#else /* H5_HAVE_WIN32_API */
#if !defined strdup && !defined H5_HAVE_STRDUP
extern char *strdup(const char *s);
#endif
-#define HDstrdup(S) strdup(S)
+#define HDstrdup(S) strdup(S)
-#endif /* _WIN32 */
+#endif /* H5_HAVE_WIN32_API */
H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
-#define HDstrcmp(S,T) strcmp(S,T)
-#define HDstrlen(S) strlen(S)
-#define HDstrncmp(S,T,L) strncmp(S,T,L)
-#define HDstrncpy(X,Y,Z) strncpy(X,Y,Z)
-#define HDstrchr(S,C) strchr(S,C)
-#define HDfree(M) free(M)
+#define HDstrcmp(S,T) strcmp(S,T)
+#define HDstrlen(S) strlen(S)
+#define HDstrncmp(S,T,L) strncmp(S,T,L)
+#define HDstrncpy(X,Y,Z) strncpy(X,Y,Z)
+#define HDstrchr(S,C) strchr(S,C)
+#define HDfree(M) free(M)
#ifdef _O_BINARY
-#define HDopen(S,F,M) open(S,F|_O_BINARY,M)
+#define HDopen(S,F,M) open(S,F|_O_BINARY,M)
#else
-#define HDopen(S,F,M) open(S,F,M)
+#define HDopen(S,F,M) open(S,F,M)
#endif
-#define HDclose(F) close(F)
+#define HDclose(F) close(F)
-#ifdef _WIN32
-#define HDlseek(F,O,W) _lseeki64(F,O,W)
+#ifdef H5_HAVE_WIN32_API
+#define HDlseek(F,O,W) _lseeki64(F,O,W)
#else
-#define HDlseek(F,O,W) lseek(F,O,W)
+#define HDlseek(F,O,W) lseek(F,O,W)
#endif
-#define HDwrite(F,M,Z) write(F,M,Z)
+#define HDwrite(F,M,Z) write(F,M,Z)
-#define HDread(F,M,Z) read(F,M,Z)
+#define HDread(F,M,Z) read(F,M,Z)
-#ifdef _WIN32
- #define HDstat(S,B) _stati64(S,B)
+#ifdef H5_HAVE_WIN32_API
+ #define HDstat(S,B) _stati64(S,B)
#else
#define HDstat(S,B) stat(S,B)
#endif
-#ifdef _WIN32
-#define HDfstat(F,B) _fstati64(F,B)
-typedef struct _stati64 h5_stat_t;
-typedef __int64 h5_stat_size_t;
+#ifdef H5_HAVE_WIN32_API
+#define HDfstat(F,B) _fstati64(F,B)
+typedef struct _stati64 h5_stat_t;
+typedef __int64 h5_stat_size_t;
#else
#define HDfstat(F,B) fstat(F,B)
-typedef struct stat h5_stat_t;
+typedef struct stat h5_stat_t;
typedef off_t h5_stat_size_t;
#endif
@@ -134,7 +134,7 @@ extern const char *opt_arg; /* flag argument (or value) */
enum {
no_arg = 0, /* doesn't take an argument */
- require_arg, /* requires an argument */
+ require_arg, /* requires an argument */
optional_arg /* argument is optional */
};
diff --git a/perform/sio_standalone.h b/perform/sio_standalone.h
index 77bb7f8..677a8ae 100644
--- a/perform/sio_standalone.h
+++ b/perform/sio_standalone.h
@@ -21,7 +21,7 @@
/** From H5private.h **/
-#include "H5public.h" /* Include Public Definitions */
+#include "H5public.h" /* Include Public Definitions */
/*
@@ -129,11 +129,11 @@
#define HDfgetc(F) fgetc(F)
#define HDfgetpos(F,P) fgetpos(F,P)
#define HDfgets(S,N,F) fgets(S,N,F)
-#ifdef _WIN32
+#ifdef H5_HAVE_WIN32_API
#define HDfileno(F) _fileno(F)
-#else /* _WIN32 */
+#else /* H5_HAVE_WIN32_API */
#define HDfileno(F) fileno(F)
-#endif /* _WIN32 */
+#endif /* H5_HAVE_WIN32_API */
#define HDfloor(X) floor(X)
#define HDfmod(X,Y) fmod(X,Y)
#define HDfopen(S,M) fopen(S,M)
@@ -169,7 +169,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
* For Unix, if off_t is not 64bit big, try use the pseudo-standard
* xxx64 versions if available.
*/
-#ifdef _WIN32
+#ifdef H5_HAVE_WIN32_API
#define HDfstat(F,B) _fstati64(F,B)
#define HDlstat(S,B) _lstati64(S,B)
#define HDstat(S,B) _stati64(S,B)
@@ -202,7 +202,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
+#define HDgetlogin() Wgetlogin()
+#else /* H5_HAVE_VISUAL_STUDIO */
#define HDgetlogin() getlogin()
+#endif /* H5_HAVE_VISUAL_STUDIO */
#define HDgetpgrp() getpgrp()
#define HDgetpid() getpid()
#define HDgetppid() getppid()
@@ -235,7 +239,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#define HDlog(X) log(X)
#define HDlog10(X) log10(X)
#define HDlongjmp(J,N) longjmp(J,N)
-#ifdef _WIN32
+#ifdef H5_HAVE_WIN32_API
#define HDlseek(F,O,W) _lseeki64(F,O,W)
#else
#ifdef H5_HAVE_LSEEK64
@@ -258,18 +262,18 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#define HDmemcpy(X,Y,Z) memcpy((char*)(X),(const char*)(Y),Z)
#define HDmemmove(X,Y,Z) memmove((char*)(X),(const char*)(Y),Z)
/*
- * The (void*) cast just avoids a compiler warning in _WIN32
+ * The (void*) cast just avoids a compiler warning in H5_HAVE_VISUAL_STUDIO
*/
-#ifdef _WIN32
+#ifdef H5_HAVE_VISUAL_STUDIO
#define HDmemset(X,C,Z) memset((void*)(X),C,Z)
-#else /* _WIN32 */
+#else /* H5_HAVE_VISUAL_STUDIO */
#define HDmemset(X,C,Z) memset(X,C,Z)
-#endif /* _WIN32 */
-#ifdef _WIN32
+#endif /* H5_HAVE_VISUAL_STUDIO */
+#ifdef H5_HAVE_WIN32_API
#define HDmkdir(S,M) _mkdir(S)
-#else /* _WIN32 */
+#else /* H5_HAVE_WIN32_API */
#define HDmkdir(S,M) mkdir(S,M)
-#endif /* _WIN32 */
+#endif /* H5_HAVE_WIN32_API */
#define HDmkfifo(S,M) mkfifo(S,M)
#define HDmktime(T) mktime(T)
#define HDmodf(X,Y) modf(X,Y)
@@ -331,7 +335,7 @@ int HDremove_all(const char * fname);
#define HDsetuid(U) setuid(U)
/* Windows does not permit setting the buffer size to values
less than 2. */
-#ifndef _WIN32
+#ifndef H5_HAVE_WIN32_API
#define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,Z)
#else
#define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,(Z>1?Z:2))
@@ -350,7 +354,7 @@ int HDremove_all(const char * fname);
#define HDsin(X) sin(X)
#define HDsinh(X) sinh(X)
#define HDsleep(N) sleep(N)
-#ifdef _WIN32
+#ifdef H5_HAVE_WIN32_API
#define HDsnprintf _snprintf /*varargs*/
#else
#define HDsnprintf snprintf /*varargs*/
@@ -369,7 +373,7 @@ H5_DLL void HDsrand(unsigned int seed);
#endif
/* sscanf() variable arguments */
-#define HDstrcasecmp(X,Y) strcasecmp(X,Y)
+#define HDstrcasecmp(X,Y) strcasecmp(X,Y)
#define HDstrcat(X,Y) strcat(X,Y)
#define HDstrchr(S,C) strchr(S,C)
#define HDstrcmp(X,Y) strcmp(X,Y)
@@ -415,7 +419,7 @@ H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base);
#define HDumask(N) umask(N)
#define HDuname(S) uname(S)
#define HDungetc(C,F) ungetc(C,F)
-#ifdef _WIN32
+#ifdef H5_HAVE_WIN32_API
#define HDunlink(S) _unlink(S)
#else
#define HDunlink(S) unlink(S)
@@ -428,7 +432,7 @@ H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base);
#define HDvfprintf(F,FMT,A) vfprintf(F,FMT,A)
#define HDvprintf(FMT,A) vprintf(FMT,A)
#define HDvsprintf(S,FMT,A) vsprintf(S,FMT,A)
-#ifdef _WIN32
+#ifdef H5_HAVE_WIN32_API
# define HDvsnprintf(S,N,FMT,A) _vsnprintf(S,N,FMT,A)
#else
# define HDvsnprintf(S,N,FMT,A) vsnprintf(S,N,FMT,A)
@@ -443,9 +447,9 @@ H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base);
* And now for a couple non-Posix functions... Watch out for systems that
* define these in terms of macros.
*/
-#ifdef _WIN32
+#ifdef H5_HAVE_WIN32_API
#define HDstrdup(S) _strdup(S)
-#else /* _WIN32 */
+#else /* H5_HAVE_WIN32_API */
#if !defined strdup && !defined H5_HAVE_STRDUP
extern char *strdup(const char *s);
@@ -453,7 +457,7 @@ extern char *strdup(const char *s);
#define HDstrdup(S) strdup(S)
-#endif /* _WIN32 */
+#endif /* H5_HAVE_WIN32_API */
/*
* HDF Boolean type.
@@ -487,7 +491,7 @@ extern const char *opt_arg; /* flag argument (or value) */
enum {
no_arg = 0, /* doesn't take an argument */
- require_arg, /* requires an argument */
+ require_arg, /* requires an argument */
optional_arg /* argument is optional */
};