Quellcode durchsuchen

Check for low _MSC_VER, not high. On windows, always use winsock.

svn:r2575
Nick Mathewson vor 20 Jahren
Ursprung
Commit
6899b8001a
3 geänderte Dateien mit 12 neuen und 11 gelöschten Zeilen
  1. 5 5
      src/common/util.h
  2. 6 5
      src/or/or.h
  3. 1 1
      src/or/test.c

+ 5 - 5
src/common/util.h

@@ -24,15 +24,15 @@
 #error "It seems your platform does not represent NULL as zero. We can't cope."
 #endif
 
-#ifdef HAVE_WINSOCK_H
+#ifdef MS_WINDOWS
+#if (_MSC_VER <= 1300)
 #include <winsock.h>
-#endif
-#if _MSC_VER > 1300
+#else
 #include <winsock2.h>
 #include <ws2tcpip.h>
-#elif defined(_MSC_VER)
-#include <winsock.h>
 #endif
+#endif
+
 #if !defined(HAVE_GETTIMEOFDAY) && !defined(HAVE_STRUCT_TIMEVAL_TV_SEC)
 struct timeval {
   time_t tv_sec;

+ 6 - 5
src/or/or.h

@@ -94,14 +94,15 @@
 #ifdef HAVE_TIME_H
 #include <time.h>
 #endif
-#ifdef HAVE_WINSOCK_H
+
+
+#ifdef MS_WINDOWS
+#if (_MSC_VER <= 1300)
 #include <winsock.h>
-#endif
-#if _MSC_VER > 1300
+#else
 #include <winsock2.h>
 #include <ws2tcpip.h>
-#elif defined(_MSC_VER)
-#include <winsock.h>
+#endif
 #endif
 
 #ifdef MS_WINDOWS

+ 1 - 1
src/or/test.c

@@ -51,7 +51,7 @@ setup_directory()
   if (is_setup) return;
 
   sprintf(temp_dir, "/tmp/tor_test_%d", (int) getpid());
-#ifdef _MSC_VER
+#ifdef MS_WINDOWS
   r = mkdir(temp_dir);
 #else
   r = mkdir(temp_dir, 0700);