summaryrefslogtreecommitdiffstats
path: root/perform/zip_perf.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2010-04-15 21:26:43 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2010-04-15 21:26:43 (GMT)
commitbb248deb5bb48820301848693692b0ee362a6277 (patch)
tree080ef9e110fc0739e278fbdb28c7cac17fc919bc /perform/zip_perf.c
parent0cf2a97cfbb6261cea3645d9109a7313e8bb9f5a (diff)
downloadhdf5-bb248deb5bb48820301848693692b0ee362a6277.zip
hdf5-bb248deb5bb48820301848693692b0ee362a6277.tar.gz
hdf5-bb248deb5bb48820301848693692b0ee362a6277.tar.bz2
[svn-r18581] Changes made to allow building programs on windows machines.
Tested: Windows, Local linux
Diffstat (limited to 'perform/zip_perf.c')
-rw-r--r--perform/zip_perf.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/perform/zip_perf.c b/perform/zip_perf.c
index d1d36b4..7d96405 100644
--- a/perform/zip_perf.c
+++ b/perform/zip_perf.c
@@ -28,14 +28,15 @@
#include <errno.h>
#include <fcntl.h>
#include <math.h>
-#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
+
+#ifdef H5_HAVE_UNISTD_H
+# include <unistd.h>
+#endif
/* our header files */
-#include "hdf5.h"
-#include "H5private.h"
+#include "h5test.h"
#include "h5tools_utils.h"
#ifdef H5_HAVE_FILTER_DEFLATE
@@ -86,6 +87,9 @@
#define FALSE (!TRUE)
#endif /* FALSE */
+#ifndef S_IRWXU
+#define S_IRWXU (_S_IREAD|_S_IWRITE)
+#endif
/* internal variables */
static const char *prog;
@@ -214,9 +218,9 @@ write_file(Bytef *source, uLongf sourceLen)
if (!dest)
error("out of memory");
- gettimeofday(&timer_start, NULL);
+ HDgettimeofday(&timer_start, NULL);
compress_buffer(dest, &destLen, source, sourceLen);
- gettimeofday(&timer_stop, NULL);
+ HDgettimeofday(&timer_stop, NULL);
compression_time += ((double)timer_stop.tv_sec +
((double)timer_stop.tv_usec) / MICROSECOND) -
@@ -508,7 +512,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size,
printf("\n");
/* do uncompressed data write */
- gettimeofday(&timer_start, NULL);
+ HDgettimeofday(&timer_start, NULL);
output = HDopen(filename, O_RDWR | O_CREAT, S_IRWXU);
if (output == -1)
@@ -534,7 +538,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size,
}
close(output);
- gettimeofday(&timer_stop, NULL);
+ HDgettimeofday(&timer_stop, NULL);
total_time = ((double)timer_stop.tv_sec +
((double)timer_stop.tv_usec) / MICROSECOND) -
@@ -554,13 +558,13 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size,
error(strerror(errno));
report_once_flag = 1;
- gettimeofday(&timer_start, NULL);
+ HDgettimeofday(&timer_start, NULL);
for (total_len = 0; total_len < file_size; total_len += src_len)
write_file(src, src_len);
close(output);
- gettimeofday(&timer_stop, NULL);
+ HDgettimeofday(&timer_stop, NULL);
total_time = ((double)timer_stop.tv_sec +
((double)timer_stop.tv_usec) / MICROSECOND) -