From: Arokux B Date: Thu, 28 Feb 2013 01:18:38 +0000 (+0800) Subject: fix win32 gettimeofday for mingw X-Git-Tag: accepted/2.0/20130307.220733~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=38d645113bbb9e3143bc91285c80ad68506a5e7c;p=profile%2Fivi%2Flibwebsockets.git fix win32 gettimeofday for mingw here are the problems that I found while compiling libwebsockets with CMake using as a generator MinGW Makefiles. 1. In http://git.warmcat.com/cgi-bin/cgit/libwebsockets/plain/win32port/win32helpers/gettimeofday.c Remove spaces around time.h, otherwise it looks for " time.h " and fails with "No such file ..." I also needed to comment out struct timezone { int tz_minuteswest; /* minutes W of Greenwich */ int tz_dsttime; /* type of dst correction */ }; It is already declared in mingw's time.h Signed-off-by: Arokux B --- diff --git a/win32port/win32helpers/gettimeofday.c b/win32port/win32helpers/gettimeofday.c index a424db9..1bb835b 100644 --- a/win32port/win32helpers/gettimeofday.c +++ b/win32port/win32helpers/gettimeofday.c @@ -1,16 +1,22 @@ -#include < time.h > +#include #include //I've ommited context line. #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) #define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64 #else #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL #endif - + +#ifdef __MINGW32__ +#else + #ifdef __MINGW64__ + #else struct timezone { int tz_minuteswest; /* minutes W of Greenwich */ int tz_dsttime; /* type of dst correction */ }; + #endif +#endif int gettimeofday(struct timeval *tv, struct timezone *tz) {