]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Remove checks for visual C 6.
authorNick Mathewson <nickm@torproject.org>
Mon, 29 Jun 2015 16:55:03 +0000 (12:55 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 29 Jun 2015 16:55:03 +0000 (12:55 -0400)
changes/win-macros
configure.ac
src/common/address.c
src/common/aes.c
src/common/compat.h
src/common/crypto.c
src/common/torlog.h
src/common/tortls.c
src/or/or.h
src/test/test_address.c
src/tools/tor-resolve.c

index a3519c39d35d70ace9a0ce930ad36b07b0c839e2..a46a474d087849dc63cc3f9b03820f1423506999 100644 (file)
@@ -2,6 +2,6 @@
     - Define WINVER and _WIN32_WINNT centrally, in orconfig.h, in order
       to ensure they remain consistent and visible everywhere.
 
-    - Remove vestigial workarounds for some ancient versions of the MSVC
-      compiler.
+    - Remove some vestigial workarounds for the MSVC6 compiler.  We haven't
+      supported that in ages.
 
index 23d4c98f5d807d44ecd674203578874ed1151055..0f93e461f4cfc7242cbb38c6688a7cbe5bb74faa 100644 (file)
@@ -335,6 +335,12 @@ bwin32=true; AC_MSG_RESULT([yes]),
 bwin32=false; AC_MSG_RESULT([no]))
 fi
 
+if test "$bwin32" = yes; then
+  AC_DEFINE(WIN32_LEAN_AND_MEAN, 1, [Defined to avoid including some windows headers])
+  AC_DEFINE(WINVER, 0x0501, [Defined to access windows functions and definitions for >=WinXP])
+  AC_DEFINE(_WIN32_WINNT, 0x0501, [Defined to access windows functions and definitions for >=WinXP])
+fi
+
 AM_CONDITIONAL(BUILD_NT_SERVICES, test x$bwin32 = xtrue)
 
 dnl Enable C99 when compiling with MIPSpro
@@ -1122,13 +1128,9 @@ AC_CHECK_TYPES([struct in6_addr, struct sockaddr_in6, sa_family_t], , ,
 #ifdef _WIN32
 #define _WIN32_WINNT 0x0501
 #define WIN32_LEAN_AND_MEAN
-#if defined(_MSC_VER) && (_MSC_VER < 1300)
-#include <winsock.h>
-#else
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #endif
-#endif
 ])
 AC_CHECK_MEMBERS([struct in6_addr.s6_addr32, struct in6_addr.s6_addr16, struct sockaddr_in.sin_len, struct sockaddr_in6.sin6_len], , ,
 [#ifdef HAVE_SYS_TYPES_H
@@ -1146,9 +1148,6 @@ AC_CHECK_MEMBERS([struct in6_addr.s6_addr32, struct in6_addr.s6_addr16, struct s
 #ifdef _WIN32
 #define _WIN32_WINNT 0x0501
 #define WIN32_LEAN_AND_MEAN
-#if defined(_MSC_VER) && (_MSC_VER < 1300)
-#include <winsock.h>
-#else
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #endif
index 6bd107889af532e12a3bf26b0cf4765c3550db5a..d7d815e40ffc4371d9b6bc21627a28ab8f46e8f1 100644 (file)
 
 #define ADDRESS_PRIVATE
 
+#include "orconfig.h"
+
 #ifdef _WIN32
 /* For access to structs needed by GetAdaptersAddresses */
-#undef _WIN32_WINNT
-#define _WIN32_WINNT 0x0501
 #include <process.h>
 #include <winsock2.h>
 #include <windows.h>
 #include <iphlpapi.h>
 #endif
 
-#include "orconfig.h"
 #include "compat.h"
 #include "util.h"
 #include "address.h"
index 8b9d81fa10bf6594711a9c17ff074c3067683aa9..5f2c3f2f034ee29a0d42b74366041a0d87b5dc6e 100644 (file)
 #include "orconfig.h"
 
 #ifdef _WIN32 /*wrkard for dtls1.h >= 0.9.8m of "#include <winsock.h>"*/
- #ifndef _WIN32_WINNT
- #define _WIN32_WINNT 0x0501
- #endif
- #define WIN32_LEAN_AND_MEAN
- #if defined(_MSC_VER) && (_MSC_VER < 1300)
-    #include <winsock.h>
- #else
-    #include <winsock2.h>
-    #include <ws2tcpip.h>
- #endif
+  #include <winsock2.h>
+  #include <ws2tcpip.h>
 #endif
 
 #include <openssl/opensslv.h>
index e1b860f229e209175cb6c78cf1e1c479c6215bb9..fbaeb6fe017e5e964f9aba089debb0fbcbbf4a2b 100644 (file)
 #include "torint.h"
 #include "testsupport.h"
 #ifdef _WIN32
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0501
-#endif
-#define WIN32_LEAN_AND_MEAN
-#if defined(_MSC_VER) && (_MSC_VER < 1300)
-#include <winsock.h>
-#else
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #endif
-#endif
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif
 
 /* Try to get a reasonable __func__ substitute in place. */
 #if defined(_MSC_VER)
-/* MSVC compilers before VC7 don't have __func__ at all; later ones call it
- * __FUNCTION__. */
-#if _MSC_VER < 1300
-#define __func__ "???"
-#else
+
 #define __func__ __FUNCTION__
-#endif
 
 #else
 /* For platforms where autoconf works, make sure __func__ is defined
 #endif /* ifndef MAVE_MACRO__func__ */
 #endif /* if not windows */
 
-#if defined(_MSC_VER) && (_MSC_VER < 1300)
-/* MSVC versions before 7 apparently don't believe that you can cast uint64_t
- * to double and really mean it. */
-extern INLINE double U64_TO_DBL(uint64_t x) {
-  int64_t i = (int64_t) x;
-  return (i < 0) ? ((double) INT64_MAX) : (double) i;
-}
-#define DBL_TO_U64(x) ((uint64_t)(int64_t) (x))
-#else
 #define U64_TO_DBL(x) ((double) (x))
 #define DBL_TO_U64(x) ((uint64_t) (x))
-#endif
 
 #ifdef ENUM_VALS_ARE_SIGNED
 #define ENUM_BF(t) unsigned
index afaf93aed2fd3c364b2d47a22575d64d852f652b..984fe952e28eef9a0f93d111cc4190e73ca0295b 100644 (file)
 #include "orconfig.h"
 
 #ifdef _WIN32
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0501
-#endif
-#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <wincrypt.h>
 /* Windows defines this; so does OpenSSL 0.9.8h and later. We don't actually
index 8923a9e2131307283eeb454ed1e536aa97c07dc1..710313a9a6339ac8f3d33ad5dc2e874ff1b4eeaf 100644 (file)
@@ -210,16 +210,6 @@ void log_notice_(log_domain_mask_t domain, const char *format, ...);
 void log_warn_(log_domain_mask_t domain, const char *format, ...);
 void log_err_(log_domain_mask_t domain, const char *format, ...);
 
-#if defined(_MSC_VER) && _MSC_VER < 1300
-/* MSVC 6 and earlier don't have __func__, or even __LINE__. */
-#define log_fn log_fn_
-#define log_fn_ratelim log_fn_ratelim_
-#define log_debug log_debug_
-#define log_info log_info_
-#define log_notice log_notice_
-#define log_warn log_warn_
-#define log_err log_err_
-#else
 /* We don't have GCC's varargs macros, so use a global variable to pass the
  * function name to log_fn */
 extern const char *log_fn_function_name_;
@@ -233,7 +223,6 @@ extern const char *log_fn_function_name_;
 #define log_notice (log_fn_function_name_=__func__),log_notice_
 #define log_warn (log_fn_function_name_=__func__),log_warn_
 #define log_err (log_fn_function_name_=__func__),log_err_
-#endif
 
 #endif /* !GNUC */
 
index bd0eaffa27abe1b1fbe4f172b54b6efb0ea46028..7447822d4858d9bbf2f0edbac545462343364022 100644 (file)
 
 #include <assert.h>
 #ifdef _WIN32 /*wrkard for dtls1.h >= 0.9.8m of "#include <winsock.h>"*/
- #ifndef _WIN32_WINNT
- #define _WIN32_WINNT 0x0501
- #endif
- #define WIN32_LEAN_AND_MEAN
- #if defined(_MSC_VER) && (_MSC_VER < 1300)
-    #include <winsock.h>
- #else
-    #include <winsock2.h>
-    #include <ws2tcpip.h>
- #endif
+  #include <winsock2.h>
+  #include <ws2tcpip.h>
 #endif
 
 #ifdef __GNUC__
index d3a476ecf95900768e5998eafa1a2a5247ebedd2..0950277bba6b5042e98e3c4d564ffe03337762b0 100644 (file)
 #endif
 #endif
 
-#ifdef _WIN32
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0501
-#endif
-#define WIN32_LEAN_AND_MEAN
-#endif
-
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
index d13d678f3d1c934da52a8db7379ea5df53e93e25..9d6456315c933fa84cfb36c3309a71dd2a73dc56 100644 (file)
@@ -3,11 +3,11 @@
 
 #define ADDRESS_PRIVATE
 
+#include "orconfig.h"
+
 #ifdef _WIN32
 #include <winsock2.h>
 /* For access to structs needed by GetAdaptersAddresses */
-#undef _WIN32_WINNT
-#define _WIN32_WINNT 0x0501
 #include <iphlpapi.h>
 #endif
 
index 19e3a554faffea480075cec193f0a1d425a1aa1b..08bce15e693e2326d2dcf2d0d8a32d2a362417b9 100644 (file)
 #endif
 
 #ifdef _WIN32
-#if defined(_MSC_VER) && (_MSC_VER <= 1300)
-#include <winsock.h>
-#else
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #endif
-#endif
 
 #define RESPONSE_LEN_4 8
 #define log_sock_error(act, _s)                                         \