diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2011-04-19 20:15:21 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2011-04-19 20:15:21 (GMT) |
commit | 099b37d073e633b0cb4d8c3f41ddf5788e63e6ee (patch) | |
tree | 3316f03ab81dbbab9160aac62fefe3f78b50c1d4 /src/H5system.c | |
parent | 94cf912176257c753eaddde0acabc9a11be2e48d (diff) | |
download | hdf5-099b37d073e633b0cb4d8c3f41ddf5788e63e6ee.zip hdf5-099b37d073e633b0cb4d8c3f41ddf5788e63e6ee.tar.gz hdf5-099b37d073e633b0cb4d8c3f41ddf5788e63e6ee.tar.bz2 |
[svn-r20559] Description:
Bring r20407:20557 from trunk to revise_chunks branch
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (ember) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Diffstat (limited to 'src/H5system.c')
-rw-r--r-- | src/H5system.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/H5system.c b/src/H5system.c index 02ea625..afe07b0 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -604,25 +604,36 @@ HDremove_all(const char *fname) * *------------------------------------------------------------------------- */ -#if !defined(H5_HAVE_GETTIMEOFDAY) && defined(_WIN32) +#ifdef _WIN32 -/* Offset between 1/1/1601 and 1/1/1970 in 100 nanosec units */ +/* Offset between 1/1/1601 and 1/1/1970 in 100 nanosecond units */ #define _W32_FT_OFFSET (116444736000000000ULL) int -Wgettimeofday(struct timeval *tv, void *tz) +Wgettimeofday(struct timeval *tv, struct timezone *tz) { union { unsigned long long ns100; /*time since 1 Jan 1601 in 100ns units */ FILETIME ft; } _now; - if(tv) - { + static int tzsetflag; + + if(tv) { GetSystemTimeAsFileTime (&_now.ft); tv->tv_usec=(long)((_now.ns100 / 10ULL) % 1000000ULL ); tv->tv_sec= (long)((_now.ns100 - _W32_FT_OFFSET) / 10000000ULL); } + + if(tz) { + if(!tzsetflag) { + _tzset(); + tzsetflag = 1; + } + tz->tz_minuteswest = _timezone / 60; + tz->tz_dsttime = _daylight; + } + /* Always return 0 as per Open Group Base Specifications Issue 6. Do not set errno on error. */ return 0; |