From: Sebastian Pipping Date: Mon, 28 Mar 2016 14:33:49 +0000 (+0200) Subject: Use GetSystemTimeAsFileTime on Non-Cygwin-Windows with no gettimeofday X-Git-Tag: R_2_2_0~57^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=888df4247c96849f43b403ff1b10a2752ec67bc2;p=libexpat Use GetSystemTimeAsFileTime on Non-Cygwin-Windows with no gettimeofday --- diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index 73dcc788..5fdd79a9 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -695,6 +695,11 @@ static const XML_Char implicitContext[] = { static unsigned long gather_time_entropy(void) { +#ifdef COMPILING_FOR_WINDOWS + FILETIME ft; + GetSystemTimeAsFileTime(&ft); /* never fails */ + return ft.dwHighDateTime ^ ft.dwLowDateTime; +#else struct timeval tv; int gettimeofday_res; @@ -703,6 +708,7 @@ gather_time_entropy(void) /* Microseconds time is <20 bits entropy */ return tv.tv_usec; +#endif } static unsigned long