Browse Source

Try a little harder to fix the tor-ci-windows builder, or figure out why it is broke

Nick Mathewson 9 years ago
parent
commit
877354a9af
3 changed files with 22 additions and 1 deletions
  1. 16 1
      src/common/address.c
  2. 1 0
      src/common/compat.c
  3. 5 0
      src/win32/orconfig.h

+ 16 - 1
src/common/address.c

@@ -14,8 +14,23 @@
 
 #ifdef _WIN32
 /* For access to structs needed by GetAdaptersAddresses */
-#include <process.h>
+#ifndef WIN32_LEAN_AND_MEAN
+#error "orconfig.h didn't define WIN32_LEAN_AND_MEAN"
+#endif
+#ifndef WINVER
+#error "orconfig.h didn't define WINVER"
+#endif
+#ifndef _WIN32_WINNT
+#error "orconfig.h didn't define _WIN32_WINNT"
+#endif
+#if WINVER < 0x0501
+#error "winver too low"
+#endif
+#if _WIN32_WINNT < 0x0501
+#error "winver too low"
+#endif
 #include <winsock2.h>
+#include <process.h>
 #include <windows.h>
 #include <iphlpapi.h>
 #endif

+ 1 - 0
src/common/compat.c

@@ -27,6 +27,7 @@
 #include "compat.h"
 
 #ifdef _WIN32
+#include <winsock2.h>
 #include <windows.h>
 #include <sys/locking.h>
 #endif

+ 5 - 0
src/win32/orconfig.h

@@ -255,3 +255,8 @@
 #ifndef STDERR_FILENO
 #define STDERR_FILENO 2
 #endif
+
+#define WINVER 0x0501
+#define _WIN32_WINNT 0x0501
+#define WIN32_LEAN_AND_MEAN 1
+