From 9ffccb3f49e1c73b34c0bd41fd3bc7116afab4b7 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 14 May 2012 13:36:52 -0400 Subject: Remove all instances of WIN32_WINNT (without leading _) We started adding it in 59e2c77824840f back in 2004, 8 years and 3 days ago. It's time to deprogram ourselves from this cargo cult. --- configure.in | 2 -- src/common/aes.c | 3 --- src/common/compat.h | 3 --- src/common/crypto.c | 3 --- src/common/tortls.c | 3 --- src/or/or.h | 3 --- 6 files changed, 17 deletions(-) diff --git a/configure.in b/configure.in index f4e0fea704..92b7acbeba 100644 --- a/configure.in +++ b/configure.in @@ -796,7 +796,6 @@ AC_CHECK_TYPES([struct in6_addr, struct sockaddr_in6, sa_family_t], , , #include #endif #ifdef _WIN32 -#define WIN32_WINNT 0x400 #define _WIN32_WINNT 0x400 #define WIN32_LEAN_AND_MEAN #if defined(_MSC_VER) && (_MSC_VER < 1300) @@ -821,7 +820,6 @@ AC_CHECK_MEMBERS([struct in6_addr.s6_addr32, struct in6_addr.s6_addr16, struct s #include #endif #ifdef _WIN32 -#define WIN32_WINNT 0x400 #define _WIN32_WINNT 0x400 #define WIN32_LEAN_AND_MEAN #if defined(_MSC_VER) && (_MSC_VER < 1300) diff --git a/src/common/aes.c b/src/common/aes.c index a9a018851b..692f1bca92 100644 --- a/src/common/aes.c +++ b/src/common/aes.c @@ -12,9 +12,6 @@ #include "orconfig.h" #ifdef _WIN32 /*wrkard for dtls1.h >= 0.9.8m of "#include "*/ - #ifndef WIN32_WINNT - #define WIN32_WINNT 0x400 - #endif #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x400 #endif diff --git a/src/common/compat.h b/src/common/compat.h index 65e6cb49e0..f17aa0524e 100644 --- a/src/common/compat.h +++ b/src/common/compat.h @@ -9,9 +9,6 @@ #include "orconfig.h" #include "torint.h" #ifdef _WIN32 -#ifndef WIN32_WINNT -#define WIN32_WINNT 0x400 -#endif #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x400 #endif diff --git a/src/common/crypto.c b/src/common/crypto.c index e37b282757..8b1c9a658e 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -13,9 +13,6 @@ #include "orconfig.h" #ifdef _WIN32 -#ifndef WIN32_WINNT -#define WIN32_WINNT 0x400 -#endif #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x400 #endif diff --git a/src/common/tortls.c b/src/common/tortls.c index 12d982defb..180efa61db 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -22,9 +22,6 @@ #include #ifdef _WIN32 /*wrkard for dtls1.h >= 0.9.8m of "#include "*/ - #ifndef WIN32_WINNT - #define WIN32_WINNT 0x400 - #endif #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x400 #endif diff --git a/src/or/or.h b/src/or/or.h index b8fee649ea..ad0ac6d021 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -23,9 +23,6 @@ #endif #ifdef _WIN32 -#ifndef WIN32_WINNT -#define WIN32_WINNT 0x400 -#endif #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x400 #endif -- cgit v1.2.3-54-g00ecf From 21e32619146db4602bc35acd0f237a91b43fd754 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 14 May 2012 13:46:37 -0400 Subject: Bump _WIN32_WINNT to 0x0501 throughout the code This tells the windows headers to give us definitions that didn't exist before XP -- like the ones that we need for IPv6 support. See bug #5861. We didn't run into this issue with mingw, since mingw doesn't respect _WIN32_WINNT as well as it should for some of its definitions. --- changes/bug5861 | 4 ++++ configure.in | 4 ++-- src/common/aes.c | 2 +- src/common/compat.h | 2 +- src/common/crypto.c | 2 +- src/common/tortls.c | 2 +- src/or/or.h | 2 +- 7 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 changes/bug5861 diff --git a/changes/bug5861 b/changes/bug5861 new file mode 100644 index 0000000000..74a1dfb95f --- /dev/null +++ b/changes/bug5861 @@ -0,0 +1,4 @@ + o Minor bugfixes: + - Set _WIN32_WINNT to 0x0501 consistently throughout the code, so + that IPv6 stuff will compile on MSVC, and compilation issues + will be easier to track down. Fix for bug 5861. diff --git a/configure.in b/configure.in index 92b7acbeba..43c9bb2a5e 100644 --- a/configure.in +++ b/configure.in @@ -796,7 +796,7 @@ AC_CHECK_TYPES([struct in6_addr, struct sockaddr_in6, sa_family_t], , , #include #endif #ifdef _WIN32 -#define _WIN32_WINNT 0x400 +#define _WIN32_WINNT 0x0501 #define WIN32_LEAN_AND_MEAN #if defined(_MSC_VER) && (_MSC_VER < 1300) #include @@ -820,7 +820,7 @@ AC_CHECK_MEMBERS([struct in6_addr.s6_addr32, struct in6_addr.s6_addr16, struct s #include #endif #ifdef _WIN32 -#define _WIN32_WINNT 0x400 +#define _WIN32_WINNT 0x0501 #define WIN32_LEAN_AND_MEAN #if defined(_MSC_VER) && (_MSC_VER < 1300) #include diff --git a/src/common/aes.c b/src/common/aes.c index 692f1bca92..1cb6b86a82 100644 --- a/src/common/aes.c +++ b/src/common/aes.c @@ -13,7 +13,7 @@ #ifdef _WIN32 /*wrkard for dtls1.h >= 0.9.8m of "#include "*/ #ifndef _WIN32_WINNT - #define _WIN32_WINNT 0x400 + #define _WIN32_WINNT 0x0501 #endif #define WIN32_LEAN_AND_MEAN #if defined(_MSC_VER) && (_MSC_VER < 1300) diff --git a/src/common/compat.h b/src/common/compat.h index f17aa0524e..b0ef63badf 100644 --- a/src/common/compat.h +++ b/src/common/compat.h @@ -10,7 +10,7 @@ #include "torint.h" #ifdef _WIN32 #ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x400 +#define _WIN32_WINNT 0x0501 #endif #define WIN32_LEAN_AND_MEAN #if defined(_MSC_VER) && (_MSC_VER < 1300) diff --git a/src/common/crypto.c b/src/common/crypto.c index 8b1c9a658e..f82598fab2 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -14,7 +14,7 @@ #ifdef _WIN32 #ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x400 +#define _WIN32_WINNT 0x0501 #endif #define WIN32_LEAN_AND_MEAN #include diff --git a/src/common/tortls.c b/src/common/tortls.c index 180efa61db..1120f3e8be 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -23,7 +23,7 @@ #include #ifdef _WIN32 /*wrkard for dtls1.h >= 0.9.8m of "#include "*/ #ifndef _WIN32_WINNT - #define _WIN32_WINNT 0x400 + #define _WIN32_WINNT 0x0501 #endif #define WIN32_LEAN_AND_MEAN #if defined(_MSC_VER) && (_MSC_VER < 1300) diff --git a/src/or/or.h b/src/or/or.h index ad0ac6d021..76681c9eea 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -24,7 +24,7 @@ #ifdef _WIN32 #ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x400 +#define _WIN32_WINNT 0x0501 #endif #define WIN32_LEAN_AND_MEAN #endif -- cgit v1.2.3-54-g00ecf