[or-cvs] r11037: Try (once again) to fix mingw build wrt detecting ipv6 types (in tor/trunk: . src/common)

nickm at seul.org nickm at seul.org
Thu Aug 2 17:30:43 UTC 2007


Author: nickm
Date: 2007-08-02 13:30:42 -0400 (Thu, 02 Aug 2007)
New Revision: 11037

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/configure.in
   tor/trunk/src/common/compat.h
Log:
 r13907 at Kushana:  nickm | 2007-08-02 10:29:13 -0700
 Try (once again) to fix mingw build wrt detecting ipv6 types.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r13907] on c95137ef-5f19-0410-b913-86e773d04f59

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-08-02 12:02:44 UTC (rev 11036)
+++ tor/trunk/ChangeLog	2007-08-02 17:30:42 UTC (rev 11037)
@@ -1,3 +1,8 @@
+Changes in version 0.2.0.5-alpha - 2007-??-??
+  o Major bugfixes (compilation):
+    - Try to fix win32 compilation again: Improve checking for ipv6 types.
+
+
 Changes in version 0.2.0.4-alpha - 2007-08-01
   o Major security fixes:
     - Close immediately after missing authentication on control port;

Modified: tor/trunk/configure.in
===================================================================
--- tor/trunk/configure.in	2007-08-02 12:02:44 UTC (rev 11036)
+++ tor/trunk/configure.in	2007-08-02 17:30:42 UTC (rev 11037)
@@ -329,7 +329,7 @@
 
 AC_CHECK_TYPES([uint, u_char])
 
-AC_CHECK_TYPES([struct in6_addr, struct sockaddr_in6, struct sockaddr_storage], , ,
+AC_CHECK_TYPES([struct in6_addr, struct sockaddr_in6, struct sockaddr_storage, sa_family_t], , ,
 [#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
@@ -341,7 +341,19 @@
 #endif
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
-#endif])
+#endif
+#ifdef MS_WINDOWS
+#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
+])
 
 if test -z "$CROSS_COMPILE"; then
 AC_CACHE_CHECK([whether time_t is signed], tor_cv_time_t_signed, [

Modified: tor/trunk/src/common/compat.h
===================================================================
--- tor/trunk/src/common/compat.h	2007-08-02 12:02:44 UTC (rev 11036)
+++ tor/trunk/src/common/compat.h	2007-08-02 17:30:42 UTC (rev 11037)
@@ -294,9 +294,14 @@
 #endif
 #endif
 
-#if !defined(HAVE_STRUCT_SOCKADDR_IN6)
+#ifndef HAVE_SA_FAMILY_T
+typedef uint16_t sa_family_t;
+#endif
+
+/* XXXX020 detect sockaddr_in6 correctly on ms_windows; this is also a hack. */
+#if !defined(HAVE_STRUCT_SOCKADDR_IN6) && !defined(MS_WINDOWS)
 struct sockaddr_in6 {
-  uint16_t sin6_family; /* XXXX020 right size???? */
+  sa_family_t sin6_family;
   uint16_t sin6_port;
   // uint32_t sin6_flowinfo;
   struct in6_addr sin6_addr;



More information about the tor-commits mailing list