Fixes for building with MinGW
authorStephan Eberle <stephaneberle9@gmail.com>
Tue, 26 Apr 2016 20:05:19 +0000 (22:05 +0200)
committerAndy Green <andy@warmcat.com>
Tue, 26 Apr 2016 23:31:22 +0000 (07:31 +0800)
Added fixes to avoid compile errors and warnings when building under
Windows using MinGW

CMakeLists.txt
lib/lws-plat-win.c
lib/server.c
win32port/win32helpers/gettimeofday.h

index d4efa96..589bd47 100644 (file)
@@ -49,6 +49,7 @@ if(GIT_EXECUTABLE)
     OUTPUT_VARIABLE GIT_HOST
     OUTPUT_STRIP_TRAILING_WHITESPACE
     )
+       string(REGEX REPLACE "([^\\])[\\]([^\\])" "\\1\\\\\\\\\\2" GIT_USER ${GIT_USER})
     set(LWS_BUILD_HASH ${GIT_USER}@${GIT_HOST}-${GIT_HASH})
     message("Git commit hash: ${LWS_BUILD_HASH}")
 endif()
index 67c3c12..dd3e95a 100644 (file)
@@ -541,7 +541,6 @@ _lws_plat_file_read(struct lws *wsi, lws_filefd_type fd, unsigned long *amount,
 {
        DWORD _amount;
 
-       (void *)wsi;
        if (!ReadFile((HANDLE)fd, buf, (DWORD)len, &_amount, NULL)) {
                *amount = 0;
 
index 5fd1517..a0194c4 100644 (file)
@@ -233,7 +233,6 @@ int lws_http_serve(struct lws *wsi, char *uri, const char *origin)
        char path[256], sym[256];
        unsigned char *p = (unsigned char *)sym + 32 + LWS_PRE, *start = p;
        unsigned char *end = p + sizeof(sym) - 32 - LWS_PRE;
-       size_t len;
        int n, spin = 0;
 
        snprintf(path, sizeof(path) - 1, "%s/%s", origin, uri);
index 720cb10..0038062 100644 (file)
@@ -7,6 +7,8 @@
   #define DELTA_EPOCH_IN_MICROSECS  11644473600000000ULL
 #endif
 
+#include <winsock2.h>
+
 #ifndef _TIMEZONE_DEFINED 
 struct timezone 
 {