Changes to enable WIN CE support
authorOndraCo <OndraCo@gmail.com>
Thu, 5 May 2016 23:50:17 +0000 (07:50 +0800)
committerAndy Green <andy@warmcat.com>
Thu, 5 May 2016 23:50:17 +0000 (07:50 +0800)
changelog
lib/libwebsockets.h
lib/lws-plat-win.c
lib/private-libwebsockets.h

index 7b1b536..be73991 100644 (file)
--- a/changelog
+++ b/changelog
@@ -8,6 +8,7 @@ Fixes
 
 2) Fix IPV6 build breakage
 
+3) Some fixes for WinCE build
 
 
 v2.0.0
index 82ed98d..d0cdfb6 100644 (file)
@@ -112,16 +112,17 @@ struct sockaddr_in;
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #include <stddef.h>
-#include <stdint.h>
 #include <basetsd.h>
 #ifndef _WIN32_WCE
+#include <stdint.h>
 #include <fcntl.h>
 #else
 #define _O_RDONLY      0x0000
 #define O_RDONLY       _O_RDONLY
 #endif
 
-#ifdef _WIN32_WCE
+// Visual studio older than 2015 and WIN_CE has only _stricmp
+#if (defined(_MSC_VER) && _MSC_VER < 1900) || defined(_WIN32_WCE)
 #define strcasecmp _stricmp
 #else
 #define strcasecmp stricmp
index dd3e95a..842423b 100644 (file)
@@ -31,7 +31,10 @@ time_in_microseconds()
 time_t time(time_t *t)
 {
        time_t ret = time_in_microseconds() / 1000000;
-       *t = ret;
+
+       if(t != NULL)
+               *t = ret;
+
        return ret;
 }
 #endif
index 23f8f4d..9ef1994 100644 (file)
@@ -87,7 +87,7 @@
 #define __func__ __FUNCTION__
 #endif
 
-#ifdef _WIN32_WCE
+#if defined(_MSC_VER) || defined(_WIN32_WCE)
 #define vsnprintf _vsnprintf
 #else
 #ifdef LWS_HAVE__VSNPRINTF