From bb248deb5bb48820301848693692b0ee362a6277 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Apr 2010 16:26:43 -0500 Subject: [svn-r18581] Changes made to allow building programs on windows machines. Tested: Windows, Local linux --- perform/perf_meta.c | 5 +---- perform/zip_perf.c | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/perform/perf_meta.c b/perform/perf_meta.c index b3966d6..8c3b06f 100644 --- a/perform/perf_meta.c +++ b/perform/perf_meta.c @@ -20,9 +20,6 @@ * Purpose: Tests performance of metadata */ -#include -#include -#include #include "h5test.h" #ifdef H5_HAVE_PARALLEL @@ -685,7 +682,7 @@ double retrieve_time(void) if(facc_type == FACC_DEFAULT) { #endif /*H5_HAVE_PARALLEL*/ struct timeval t; - gettimeofday(&t, NULL); + HDgettimeofday(&t, NULL); return ((double)t.tv_sec + (double)t.tv_usec / 1000000); #ifdef H5_HAVE_PARALLEL } else { 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 #include #include -#include #include #include -#include + +#ifdef H5_HAVE_UNISTD_H +# include +#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) - -- cgit v0.12