16 #ifndef GEOS_TIMEVAL_H
17 #define GEOS_TIMEVAL_H
19 #ifndef WIN32_LEAN_AND_MEAN
20 #define WIN32_LEAN_AND_MEAN
26 #if defined(_MSC_VER) || defined(__BORLANDC__)
27 #define EPOCHFILETIME (116444736000000000i64)
29 #define EPOCHFILETIME (116444736000000000LL)
38 #if !defined(_WIN32_WCE)
40 __inline
int gettimeofday(
struct timeval *tv,
struct timezone *tz)
49 GetSystemTimeAsFileTime(&ft);
50 li.LowPart = ft.dwLowDateTime;
51 li.HighPart = ft.dwHighDateTime;
55 tv->tv_sec = (long)(t / 1000000);
56 tv->tv_usec = (long)(t % 1000000);
66 tz->tz_minuteswest = _timezone / 60;
67 tz->tz_dsttime = _daylight;
75 __inline
int gettimeofday(
struct timeval *tv,
struct timezone *tz)
80 TIME_ZONE_INFORMATION tzi;
87 SystemTimeToFileTime(&st, &ft);
88 li.LowPart = ft.dwLowDateTime;
89 li.HighPart = ft.dwHighDateTime;
93 tv->tv_sec = (long)(t / 1000000);
94 tv->tv_usec = (long)(t % 1000000);
99 GetTimeZoneInformation(&tzi);
101 tz->tz_minuteswest = tzi.Bias;
102 if (tzi.StandardDate.wMonth != 0)
104 tz->tz_minuteswest += tzi.StandardBias * 60;
107 if (tzi.DaylightDate.wMonth != 0)