Browse Source

SGW: For Windows builds, include winsock2.h instead of POSIX networking headers

Luke Dashjr 12 years ago
parent
commit
28375e3647
2 changed files with 15 additions and 0 deletions
  1. 7 0
      driver-getwork.c
  2. 8 0
      httpsrv.c

+ 7 - 0
driver-getwork.c

@@ -9,10 +9,17 @@
 
 
 #include "config.h"
 #include "config.h"
 
 
+#ifdef WIN32
+#include <winsock2.h>
+#endif
+
 #include <stdint.h>
 #include <stdint.h>
+
+#ifndef WIN32
 #include <sys/types.h>
 #include <sys/types.h>
 #include <sys/select.h>
 #include <sys/select.h>
 #include <sys/socket.h>
 #include <sys/socket.h>
+#endif
 
 
 #include <jansson.h>
 #include <jansson.h>
 #include <microhttpd.h>
 #include <microhttpd.h>

+ 8 - 0
httpsrv.c

@@ -9,10 +9,18 @@
 
 
 #include "config.h"
 #include "config.h"
 
 
+#ifdef WIN32
+#include <winsock2.h>
+#endif
+
 #include <stdint.h>
 #include <stdint.h>
+
+#ifndef WIN32
 #include <sys/types.h>
 #include <sys/types.h>
 #include <sys/select.h>
 #include <sys/select.h>
 #include <sys/socket.h>
 #include <sys/socket.h>
+#endif
+
 #include <microhttpd.h>
 #include <microhttpd.h>
 
 
 #include "logging.h"
 #include "logging.h"