[svn-r18581] Changes made to allow building programs on windows machines.

Tested:
   Windows, Local linux
This commit is contained in:
Allen Byrne 2010-04-15 16:26:43 -05:00
parent 0cf2a97cfb
commit bb248deb5b
2 changed files with 15 additions and 14 deletions

View File

@ -20,9 +20,6 @@
* Purpose: Tests performance of metadata
*/
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#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 {

View File

@ -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) -