From 888df4247c96849f43b403ff1b10a2752ec67bc2 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Mon, 28 Mar 2016 16:33:49 +0200 Subject: [PATCH] Use GetSystemTimeAsFileTime on Non-Cygwin-Windows with no gettimeofday --- expat/lib/xmlparse.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.49.0