Browse Source

Move unused winsock2.h includes to the end of config.h

winsock2.h must be included before windows.h, but windows.h is included by various standard C headers
Luke Dashjr 12 years ago
parent
commit
2aee732e31
10 changed files with 6 additions and 37 deletions
  1. 0 4
      compat.h
  2. 6 0
      configure.ac
  3. 0 4
      driver-icarus.c
  4. 0 4
      driver-opencl.c
  5. 0 4
      driver-x6500.c
  6. 0 4
      ft232r.c
  7. 0 4
      jtag.c
  8. 0 1
      lowl-hid.c
  9. 0 4
      lowl-vcom.c
  10. 0 8
      ocl.c

+ 0 - 4
compat.h

@@ -12,10 +12,6 @@
 
 
 #include "config.h"
 #include "config.h"
 
 
-#ifdef WIN32
-#include <winsock2.h>
-#endif
-
 #include <stdbool.h>
 #include <stdbool.h>
 
 
 #if !(defined(WIN32) || defined(unix))
 #if !(defined(WIN32) || defined(unix))

+ 6 - 0
configure.ac

@@ -31,6 +31,12 @@ AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_SRCDIR([miner.c])
 AC_CONFIG_SRCDIR([miner.c])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_HEADERS([config.h])
 
 
+AH_BOTTOM([
+#ifdef WIN32
+#include <winsock2.h>
+#endif
+])
+
 AM_INIT_AUTOMAKE([foreign subdir-objects])
 AM_INIT_AUTOMAKE([foreign subdir-objects])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 AC_USE_SYSTEM_EXTENSIONS
 AC_USE_SYSTEM_EXTENSIONS

+ 0 - 4
driver-icarus.c

@@ -32,10 +32,6 @@
 #include "config.h"
 #include "config.h"
 #include "miner.h"
 #include "miner.h"
 
 
-#ifdef WIN32
-#include <winsock2.h>
-#endif
-
 #include <limits.h>
 #include <limits.h>
 #include <pthread.h>
 #include <pthread.h>
 #include <stdbool.h>
 #include <stdbool.h>

+ 0 - 4
driver-opencl.c

@@ -11,10 +11,6 @@
 
 
 #include "config.h"
 #include "config.h"
 
 
-#ifdef WIN32
-#include <winsock2.h>
-#endif
-
 #ifdef HAVE_CURSES
 #ifdef HAVE_CURSES
 // Must be before stdbool, since pdcurses typedefs bool :/
 // Must be before stdbool, since pdcurses typedefs bool :/
 #include <curses.h>
 #include <curses.h>

+ 0 - 4
driver-x6500.c

@@ -10,10 +10,6 @@
 
 
 #include "config.h"
 #include "config.h"
 
 
-#ifdef WIN32
-#include <winsock2.h>
-#endif
-
 #include <limits.h>
 #include <limits.h>
 #include <math.h>
 #include <math.h>
 #include <stdbool.h>
 #include <stdbool.h>

+ 0 - 4
ft232r.c

@@ -9,10 +9,6 @@
 
 
 #include "config.h"
 #include "config.h"
 
 
-#ifdef WIN32
-#include <winsock2.h>
-#endif
-
 #include <errno.h>
 #include <errno.h>
 #include <stdbool.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <stdint.h>

+ 0 - 4
jtag.c

@@ -11,10 +11,6 @@
 
 
 #include "config.h"
 #include "config.h"
 
 
-#ifdef WIN32
-#include <winsock2.h>
-#endif
-
 #include <stdbool.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <stdlib.h>

+ 0 - 1
lowl-hid.c

@@ -13,7 +13,6 @@
 #include <dlfcn.h>
 #include <dlfcn.h>
 typedef void *dlh_t;
 typedef void *dlh_t;
 #else
 #else
-#include <winsock2.h>
 #include <windows.h>
 #include <windows.h>
 #define dlopen(lib, flags) LoadLibrary(lib)
 #define dlopen(lib, flags) LoadLibrary(lib)
 #define dlsym(h, sym)  ((void*)GetProcAddress(h, sym))
 #define dlsym(h, sym)  ((void*)GetProcAddress(h, sym))

+ 0 - 4
lowl-vcom.c

@@ -12,10 +12,6 @@
 
 
 #include "config.h"
 #include "config.h"
 
 
-#ifdef WIN32
-#include <winsock2.h>
-#endif
-
 #include <ctype.h>
 #include <ctype.h>
 #include <stdarg.h>
 #include <stdarg.h>
 #include <stdbool.h>
 #include <stdbool.h>

+ 0 - 8
ocl.c

@@ -19,14 +19,6 @@
 #include <stdio.h>
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/types.h>
 
 
-#ifdef WIN32
-	#include <winsock2.h>
-#else
-	#include <sys/socket.h>
-	#include <netinet/in.h>
-	#include <netdb.h>
-#endif
-
 #include <time.h>
 #include <time.h>
 #include <sys/time.h>
 #include <sys/time.h>
 #include <pthread.h>
 #include <pthread.h>