summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2009-06-11 20:52:56 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2009-06-11 20:52:56 (GMT)
commit9f0bec79a2f8ead640fbe897d40006d70f38c3a2 (patch)
tree730f0802b9407fc9624694e6e36a21d1372727d9
parentbc2bd03a466909e874220e3f08e6abe79a5dbe9b (diff)
downloadhdf5-9f0bec79a2f8ead640fbe897d40006d70f38c3a2.zip
hdf5-9f0bec79a2f8ead640fbe897d40006d70f38c3a2.tar.gz
hdf5-9f0bec79a2f8ead640fbe897d40006d70f38c3a2.tar.bz2
[svn-r17036] Updated perf_serial test to work on windows. Bring back from trunk.
Tested: Windows
-rw-r--r--release_docs/RELEASE.txt6
-rw-r--r--src/H5private.h3
-rw-r--r--src/H5system.c46
-rw-r--r--src/H5win32defs.h13
4 files changed, 65 insertions, 3 deletions
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index bdc3f15..f9d82d6 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -107,7 +107,9 @@ Bug Fixes since HDF5-1.8.3
Tools
-----
- - None
+ - perf_serial test added to Windows projects and check batch file.
+ ADB - 2009/06/11 -1504
+
F90 API
------
@@ -124,7 +126,7 @@ Bug Fixes since HDF5-1.8.3
Fortran High-Level APIs:
------
- Lite: the h5ltread_dataset_string_f and h5ltget_attribute_string_f functions
- had memory problems with the g95 fortran compiler. (PVN – 5/13/2009) 1522
+ had memory problems with the g95 fortran compiler. (PVN � 5/13/2009) 1522
diff --git a/src/H5private.h b/src/H5private.h
index 998b7c3..ccfbd5d 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -1152,6 +1152,9 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#ifndef HDstrcmp
#define HDstrcmp(X,Y) strcmp(X,Y)
#endif /* HDstrcmp */
+#ifndef HDstrcasecmp
+ #define HDstrcasecmp(X,Y) strcasecmp(X,Y)
+#endif /* HDstrcasecmp */
#ifndef HDstrcoll
#define HDstrcoll(X,Y) strcoll(X,Y)
#endif /* HDstrcoll */
diff --git a/src/H5system.c b/src/H5system.c
index 8956e9b..36ec1c1 100644
--- a/src/H5system.c
+++ b/src/H5system.c
@@ -580,6 +580,52 @@ HDremove_all(const char *fname)
}
#endif
+/*-------------------------------------------------------------------------
+ * Function: HDgettimeofday
+ *
+ * Purpose: Wrapper function for gettimeofday on Windows systems
+ *
+ * This function can get the time as well as a timezone
+ *
+ * Return: 0
+ *
+ * This implementation is taken from the Cygwin source distribution at
+ * src/winsup/mingw/mingwex/gettimeofday.c
+ *
+ * The original source code was contributed by
+ * Danny Smith <dannysmith@users.sourceforge.net>
+ * and released in the public domain.
+ *
+ * Programmer: Scott Wegner
+ * May 19, 2009
+ *
+ *-------------------------------------------------------------------------
+ */
+#if !defined(H5_HAVE_GETTIMEOFDAY) && defined(_WIN32)
+
+/* Offset between 1/1/1601 and 1/1/1970 in 100 nanosec units */
+#define _W32_FT_OFFSET (116444736000000000ULL)
+
+int
+HDgettimeofday(struct timeval *tv, void *tz)
+ {
+ union {
+ unsigned long long ns100; /*time since 1 Jan 1601 in 100ns units */
+ FILETIME ft;
+ } _now;
+
+ if(tv)
+ {
+ GetSystemTimeAsFileTime (&_now.ft);
+ tv->tv_usec=(long)((_now.ns100 / 10ULL) % 1000000ULL );
+ tv->tv_sec= (long)((_now.ns100 - _W32_FT_OFFSET) / 10000000ULL);
+ }
+ /* Always return 0 as per Open Group Base Specifications Issue 6.
+ Do not set errno on error. */
+ return 0;
+}
+#endif
+
/*
*-------------------------------------------------------------------------
diff --git a/src/H5win32defs.h b/src/H5win32defs.h
index d710ada..89b41a0 100644
--- a/src/H5win32defs.h
+++ b/src/H5win32defs.h
@@ -43,6 +43,16 @@ typedef __int64 h5_stat_size_t;
#define HDstat(S,B) _stati64(S,B)
#define HDgetcwd(S,Z) _getcwd(S,Z)
#define HDgetdcwd(D,S,Z) _getdcwd(D,S,Z)
+#ifndef H5_HAVE_GETTIMEOFDAY
+ #ifdef __cplusplus
+ extern "C" {
+ #endif /* __cplusplus */
+ H5_DLL int HDgettimeofday(struct timeval *tv, void *tz);
+ #ifdef __cplusplus
+ }
+ #endif /* __cplusplus */
+ #define HDgettimeofday(V,Z) HDgettimeofday(V,Z)
+#endif /* H5_HAVE_GETTIMEOFDAY */
#define HDgetdrive() _getdrive()
#define HDlseek(F,O,W) _lseeki64(F,O,W)
#define HDmemset(X,C,Z) memset((void*)(X),C,Z)
@@ -50,13 +60,14 @@ typedef __int64 h5_stat_size_t;
#define HDopen(S,F,M) _open(S,F|_O_BINARY,M)
#define HDread(F,M,Z) _read(F,M,Z)
#define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,(Z>1?Z:2))
+#define HDstrcasecmp(A,B) _stricmp(A,B)
+#define HDstrtoull(S,R,N) _strtoui64(S,R,N)
#define HDstrdup(S) _strdup(S)
#define HDsnprintf _snprintf /*varargs*/
#define HDtzset() _tzset()
#define HDunlink(S) _unlink(S)
#define HDvsnprintf(S,N,FMT,A) _vsnprintf(S,N,FMT,A)
#define HDwrite(F,M,Z) _write(F,M,Z)
-#define HDstrtoull(S,R,N) _strtoui64(S,R,N)
/* Non-POSIX functions */