aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-07-15 10:03:59 -0400
committerNick Mathewson <nickm@torproject.org>2011-07-15 10:03:59 -0400
commit44cfa538731079ffd6eb5f80b2e3c19c4f8acf03 (patch)
tree40c400cfea71ca53a3db5f813547c1b0555c8163
parent852b1312812bd0174353271c5a2d42ed08c6b8a2 (diff)
downloadtor-44cfa538731079ffd6eb5f80b2e3c19c4f8acf03.tar
tor-44cfa538731079ffd6eb5f80b2e3c19c4f8acf03.tar.gz
Make WIN32_WINNT defines conditional
Requested by Gisle Vanem on tor-dev. I'm not quite sure this is the right solution, but it's probably harmless.
-rw-r--r--changes/ifdef-winnt4
-rw-r--r--src/common/compat.h4
-rw-r--r--src/common/crypto.c4
-rw-r--r--src/common/tortls.c4
-rw-r--r--src/or/or.h4
5 files changed, 20 insertions, 0 deletions
diff --git a/changes/ifdef-winnt b/changes/ifdef-winnt
new file mode 100644
index 000000000..2c6c5a232
--- /dev/null
+++ b/changes/ifdef-winnt
@@ -0,0 +1,4 @@
+ o Build changes:
+ - On Windows, we now define the _WIN32_WINNT macros only if they
+ are not already defined. This lets the person building Tor decide,
+ if they want, to require a later version of Windows.
diff --git a/src/common/compat.h b/src/common/compat.h
index 094036dff..98642e2d9 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -9,8 +9,12 @@
#include "orconfig.h"
#include "torint.h"
#ifdef MS_WINDOWS
+#ifndef WIN32_WINNT
#define WIN32_WINNT 0x400
+#endif
+#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x400
+#endif
#define WIN32_LEAN_AND_MEAN
#if defined(_MSC_VER) && (_MSC_VER < 1300)
#include <winsock.h>
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 05c1ce9ea..9ad7575a7 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -13,8 +13,12 @@
#include "orconfig.h"
#ifdef MS_WINDOWS
+#ifndef WIN32_WINNT
#define WIN32_WINNT 0x400
+#endif
+#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x400
+#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <wincrypt.h>
diff --git a/src/common/tortls.c b/src/common/tortls.c
index a208bc761..21f2c5072 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -22,8 +22,12 @@
#include <assert.h>
#ifdef MS_WINDOWS /*wrkard for dtls1.h >= 0.9.8m of "#include <winsock.h>"*/
+ #ifndef WIN32_WINNT
#define WIN32_WINNT 0x400
+ #endif
+ #ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x400
+ #endif
#define WIN32_LEAN_AND_MEAN
#if defined(_MSC_VER) && (_MSC_VER < 1300)
#include <winsock.h>
diff --git a/src/or/or.h b/src/or/or.h
index 7669efb66..7a2bde59f 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -23,8 +23,12 @@
#endif
#ifdef MS_WINDOWS
+#ifndef WIN32_WINNT
#define WIN32_WINNT 0x400
+#endif
+#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x400
+#endif
#define WIN32_LEAN_AND_MEAN
#endif