From 79a80c88eec9a9e1e81c1690de17e97e8a548dc1 Mon Sep 17 00:00:00 2001 From: Nick Mathewson <nickm@torproject.org> Date: Tue, 31 Jan 2012 11:04:27 -0500 Subject: [PATCH] Fix straggling MS_WINDOWS issues; add a changes file There was one MS_WINDOWS that remained because it wasn't on a macro line; a few remaining uses (and the definition!) in configure.in; and a now-nonsensical stanza of eventdns_tor.h that previously defined 'WIN32' if it didn't exist. --- changes/win32macro | 4 ++++ configure.in | 9 +++------ src/common/util.c | 2 +- src/or/eventdns_tor.h | 5 ----- 4 files changed, 8 insertions(+), 12 deletions(-) create mode 100644 changes/win32macro diff --git a/changes/win32macro b/changes/win32macro new file mode 100644 index 0000000000..402bb99b3a --- /dev/null +++ b/changes/win32macro @@ -0,0 +1,4 @@ + o Code simplifications and refactoring: + - Use the _WIN32 macro throughout our code to detect Windows. + (Previously we had used the obsolete 'WIN32' and the + idiosyncratic 'MS_WINDOWS'.) diff --git a/configure.in b/configure.in index ddb682379d..b97eba6dc7 100644 --- a/configure.in +++ b/configure.in @@ -257,9 +257,6 @@ bwin32=true; AC_MSG_RESULT([yes]), bwin32=false; AC_MSG_RESULT([no])) fi -if test "$bwin32" = true; then -AC_DEFINE(MS_WINDOWS, 1, [Define to 1 if we are building for Windows.]) -fi AM_CONDITIONAL(BUILD_NT_SERVICES, test x$bwin32 = xtrue) dnl Enable C99 when compiling with MIPSpro @@ -573,7 +570,7 @@ if test "$natpmp" = "true"; then AC_DEFINE(NAT_PMP, 1, [Define to 1 if we are building with nat-pmp.]) TOR_SEARCH_LIBRARY(libnatpmp, $trylibnatpmpdir, [-lnatpmp $TOR_LIB_WS32 $TOR_LIB_IPHLPAPI], [#include <natpmp.h>], - [#ifdef MS_WINDOWS + [#ifdef _WIN32 #define STATICLIB #endif #include <natpmp.h>], @@ -772,7 +769,7 @@ AC_CHECK_TYPES([struct in6_addr, struct sockaddr_in6, sa_family_t], , , #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif -#ifdef MS_WINDOWS +#ifdef _WIN32 #define WIN32_WINNT 0x400 #define _WIN32_WINNT 0x400 #define WIN32_LEAN_AND_MEAN @@ -797,7 +794,7 @@ AC_CHECK_MEMBERS([struct in6_addr.s6_addr32, struct in6_addr.s6_addr16, struct s #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif -#ifdef MS_WINDOWS +#ifdef _WIN32 #define WIN32_WINNT 0x400 #define _WIN32_WINNT 0x400 #define WIN32_LEAN_AND_MEAN diff --git a/src/common/util.c b/src/common/util.c index ac37f1ba3f..52fea2186a 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -2972,7 +2972,7 @@ finish_daemon(const char *desired_cwd) close(daemon_filedes[1]); } #else -/* defined(MS_WINDOWS) */ +/* defined(_WIN32) */ void start_daemon(void) { diff --git a/src/or/eventdns_tor.h b/src/or/eventdns_tor.h index b3bdde0176..c75cff2d1f 100644 --- a/src/or/eventdns_tor.h +++ b/src/or/eventdns_tor.h @@ -14,11 +14,6 @@ typedef unsigned char u_char; #endif #include "torint.h" -#if defined(_WIN32) && !defined(_WIN32) -/* How did _this_ happen? */ -#define _WIN32 -#endif - /* These are for debugging possible memory leaks. */ #include "util.h" #include "compat.h" -- GitLab