18 #ifndef GEOS_TIMEVAL_H 19 #define GEOS_TIMEVAL_H 22 #error This header is dedicated to Windows platform only 25 #ifndef WIN32_LEAN_AND_MEAN 26 #define WIN32_LEAN_AND_MEAN 40 #if defined(_MSC_VER) || defined(__BORLANDC__) 41 #define EPOCHFILETIME (116444736000000000i64) 43 #define EPOCHFILETIME (116444736000000000LL) 52 #if !defined(_WIN32_WCE) 54 __inline
int gettimeofday(
struct timeval *tv,
struct timezone *tz)
63 GetSystemTimeAsFileTime(&ft);
64 li.LowPart = ft.dwLowDateTime;
65 li.HighPart = ft.dwHighDateTime;
69 tv->tv_sec = (long)(t / 1000000);
70 tv->tv_usec = (long)(t % 1000000);
80 tz->tz_minuteswest = _timezone / 60;
81 tz->tz_dsttime = _daylight;
89 __inline
int gettimeofday(
struct timeval *tv,
struct timezone *tz)
94 TIME_ZONE_INFORMATION tzi;
101 SystemTimeToFileTime(&st, &ft);
102 li.LowPart = ft.dwLowDateTime;
103 li.HighPart = ft.dwHighDateTime;
107 tv->tv_sec = (long)(t / 1000000);
108 tv->tv_usec = (long)(t % 1000000);
113 GetTimeZoneInformation(&tzi);
115 tz->tz_minuteswest = tzi.Bias;
116 if (tzi.StandardDate.wMonth != 0)
118 tz->tz_minuteswest += tzi.StandardBias * 60;
121 if (tzi.DaylightDate.wMonth != 0)