diff options
author | Arokux B <arokux@gmail.com> | 2013-02-28 09:18:38 +0800 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2013-02-28 09:18:38 +0800 |
commit | e5ae9a95fb2c95b7df47f2a43d58225e667a8ada (patch) | |
tree | c058eba7bad82c52229513398de82dd4f9cf65f1 /win32port | |
parent | 975423c949793dc33bd5c58d651b8fbd861bd893 (diff) | |
download | libwebsockets-e5ae9a95fb2c95b7df47f2a43d58225e667a8ada.tar.gz |
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 <arokux@gmail.com>
Diffstat (limited to 'win32port')
-rw-r--r-- | win32port/win32helpers/gettimeofday.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/win32port/win32helpers/gettimeofday.c b/win32port/win32helpers/gettimeofday.c index a424db92..1bb835b2 100644 --- a/win32port/win32helpers/gettimeofday.c +++ b/win32port/win32helpers/gettimeofday.c @@ -1,16 +1,22 @@ -#include < time.h >
+#include <time.h>
#include <windows.h> //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)
{
|