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 7b1b536dc06985d0e2b3fd3924045f38abdb8a30..be739913da30d6ad29c20d749d9997d51f265da4 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 82ed98d922a3f9f0a1dac28f1c32b6f544e3ead5..d0cdfb6bbd45f12762bd1cfcae8b34412e85abb6 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 dd3e95a3e71e6aa5a61cfab296c7052caba33a0c..842423bf9491787652946b007edfe9f88945d933 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 23f8f4dd2b94b640499263ef66f508f87c17476e..9ef19940608c5f6439fbe1fdabc1de5fd0b598d5 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