[or-cvs] [tor/master] Fix compilation with mingw and OpenSSL 0.9.8m+

nickm at torproject.org nickm at torproject.org
Mon Jul 26 19:02:09 UTC 2010


Author: mingw-san <mingw-san>
Date: Mon, 26 Jul 2010 15:05:11 -0400
Subject: Fix compilation with mingw and OpenSSL 0.9.8m+
Commit: 856a36c43439da3478892758c0df777ac647d245

---
 changes/mingw-openssl098m |    3 +++
 src/common/tortls.c       |   11 +++++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)
 create mode 100644 changes/mingw-openssl098m

diff --git a/changes/mingw-openssl098m b/changes/mingw-openssl098m
new file mode 100644
index 0000000..b419976
--- /dev/null
+++ b/changes/mingw-openssl098m
@@ -0,0 +1,3 @@
+ o Minor features
+   - Build correctly on mingw with more recent version of OpenSSL 0.9.8.
+     Patch from mingw-san.
diff --git a/src/common/tortls.c b/src/common/tortls.c
index b3c91a6..7dfdca6 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -21,6 +21,17 @@
 #endif
 
 #include <assert.h>
+#ifdef MS_WINDOWS /*wrkard for dtls1.h >= 0.9.8m of "#include <winsock.h>"*/
+ #define WIN32_WINNT 0x400
+ #define _WIN32_WINNT 0x400
+ #define WIN32_LEAN_AND_MEAN
+ #if defined(_MSC_VER) && (_MSC_VER < 1300)
+    #include <winsock.h>
+ #else
+    #include <winsock2.h>
+    #include <ws2tcpip.h>
+ #endif
+#endif
 #include <openssl/ssl.h>
 #include <openssl/ssl3.h>
 #include <openssl/err.h>
-- 
1.7.1



More information about the tor-commits mailing list