fix win32 gettimeofday for mingw 50/3150/1
authorArokux B <arokux@gmail.com>
Thu, 28 Feb 2013 01:18:38 +0000 (09:18 +0800)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 7 Mar 2013 21:01:38 +0000 (13:01 -0800)
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 <arokux@gmail.com>
win32port/win32helpers/gettimeofday.c

index a424db9..1bb835b 100644 (file)
@@ -1,16 +1,22 @@
-#include < time.h >\r
+#include <time.h>\r
 #include <windows.h> //I've ommited context line.\r
 #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)\r
   #define DELTA_EPOCH_IN_MICROSECS  11644473600000000Ui64\r
 #else\r
   #define DELTA_EPOCH_IN_MICROSECS  11644473600000000ULL\r
 #endif\r
\r
+\r
+#ifdef __MINGW32__\r
+#else\r
+ #ifdef __MINGW64__\r
+ #else\r
 struct timezone \r
 {\r
   int  tz_minuteswest; /* minutes W of Greenwich */\r
   int  tz_dsttime;     /* type of dst correction */\r
 };\r
+ #endif\r
+#endif\r
  \r
 int gettimeofday(struct timeval *tv, struct timezone *tz)\r
 {\r