win solve various cranky problems with msvc
authorAndy Green <andy.green@linaro.org>
Thu, 17 Dec 2015 07:15:12 +0000 (15:15 +0800)
committerAndy Green <andy.green@linaro.org>
Thu, 17 Dec 2015 07:15:12 +0000 (15:15 +0800)
After emptyVoid at --->

https://github.com/warmcat/libwebsockets/issues/374

Signed-off-by: Andy Green <andy.green@linaro.org>
lib/libwebsockets.h
lib/private-libwebsockets.h
test-server/test-server.h

index 4c168d7..48cdeb2 100644 (file)
@@ -105,12 +105,6 @@ extern "C" {
 #include "lws_config.h"
 
 #if defined(WIN32) || defined(_WIN32)
-#if (WINVER < 0x0600)
-#undef WINVER
-#undef _WIN32_WINNT
-#define WINVER 0x0600
-#define _WIN32_WINNT WINVER
-#endif
 #ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN
 #endif
index a30fd58..1760ec6 100644 (file)
@@ -66,6 +66,7 @@
 #define lws_socket_is_valid(x) (!!x)
 #define LWS_SOCK_INVALID 0
 #include <winsock2.h>
+#include <ws2tcpip.h>
 #include <windows.h>
 #include <tchar.h>
 #ifdef LWS_HAVE_IN6ADDR_H
index 30bc634..7a8a922 100644 (file)
@@ -1,3 +1,9 @@
+#if defined(_WIN32) && defined(EXTERNAL_POLL)
+#define WINVER 0x0600
+#define _WIN32_WINNT 0x0600
+#define poll(fdArray, fds, timeout)  WSAPoll((LPWSAPOLLFD)(fdArray), (ULONG)(fds), (INT)(timeout))
+#endif
+
 #include "lws_config.h"
 
 #include <stdio.h>
@@ -13,9 +19,6 @@
 
 #ifdef _WIN32
 #include <io.h>
-#ifdef EXTERNAL_POLL
-#define poll WSAPoll
-#endif
 #include "gettimeofday.h"
 #else
 #include <syslog.h>