瀏覽代碼

Update civetweb.c

Updated to build clean in Visual Studio 2012 & 64 bit.  
The undef of _WIN32_WINNT is out dated at this point.

ws2tcpip.h needed to be defined in windows.

HAVE_POLL is defined in this new include, so we don't want to define it again.
grenclave 11 年之前
父節點
當前提交
e05dde8db6
共有 1 個文件被更改,包括 10 次插入1 次删除
  1. 10 1
      src/civetweb.c

+ 10 - 1
src/civetweb.c

@@ -32,6 +32,8 @@
 #endif
 #endif
 
 
 #if defined (_MSC_VER)
 #if defined (_MSC_VER)
+// 'type cast' : conversion from 'int' to 'HANDLE' of greater size
+#pragma warning (disable : 4306 )
 // conditional expression is constant: introduced by FD_SET(..)
 // conditional expression is constant: introduced by FD_SET(..)
 #pragma warning (disable : 4127)
 #pragma warning (disable : 4127)
 // non-constant aggregate initializer: issued due to missing C99 support
 // non-constant aggregate initializer: issued due to missing C99 support
@@ -44,6 +46,10 @@
 #undef WIN32_LEAN_AND_MEAN
 #undef WIN32_LEAN_AND_MEAN
 #endif
 #endif
 
 
+#ifdef USE_IPV6
+#include <ws2tcpip.h>
+#endif
+
 #if defined(__SYMBIAN32__)
 #if defined(__SYMBIAN32__)
 #define NO_SSL // SSL is not supported
 #define NO_SSL // SSL is not supported
 #define NO_CGI // CGI is not supported
 #define NO_CGI // CGI is not supported
@@ -73,8 +79,10 @@
 #include <stdio.h>
 #include <stdio.h>
 
 
 #if defined(_WIN32) && !defined(__SYMBIAN32__) // Windows specific
 #if defined(_WIN32) && !defined(__SYMBIAN32__) // Windows specific
+#if defined(_MSC_VER) && _MSC_VER <= 1400
 #undef _WIN32_WINNT
 #undef _WIN32_WINNT
 #define _WIN32_WINNT 0x0400 // To make it link in VS2005
 #define _WIN32_WINNT 0x0400 // To make it link in VS2005
+#endif
 #include <windows.h>
 #include <windows.h>
 
 
 #ifndef PATH_MAX
 #ifndef PATH_MAX
@@ -194,6 +202,7 @@ typedef struct DIR {
     struct dirent  result;
     struct dirent  result;
 } DIR;
 } DIR;
 
 
+#ifndef USE_IPV6 && defined(_WIN32)
 #ifndef HAVE_POLL
 #ifndef HAVE_POLL
 struct pollfd {
 struct pollfd {
     SOCKET fd;
     SOCKET fd;
@@ -202,7 +211,7 @@ struct pollfd {
 };
 };
 #define POLLIN 1
 #define POLLIN 1
 #endif
 #endif
-
+#endif
 
 
 // Mark required libraries
 // Mark required libraries
 #ifdef _MSC_VER
 #ifdef _MSC_VER