]> granicus.if.org Git - libevent/commitdiff
Try to build correctly on platforms with no IPv6 support
authorNick Mathewson <nickm@torproject.org>
Mon, 24 Jan 2011 23:55:10 +0000 (18:55 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 24 Jan 2011 23:55:10 +0000 (18:55 -0500)
ipv6-internal.h
util-internal.h

index 7d6fb7361b3f80d18bed814f89afa28de869ffc9..1f272a0d0ce4aabdd8b959fa4ac389e8a1e51e54 100644 (file)
@@ -59,12 +59,21 @@ typedef int sa_family_t;
 
 #ifndef _EVENT_HAVE_STRUCT_SOCKADDR_IN6
 struct sockaddr_in6 {
+       /* This will fail if we find a struct sockaddr that doesn't have
+        * sa_family as the first element. */
        sa_family_t sin6_family;
        ev_uint16_t sin6_port;
        struct in6_addr sin6_addr;
 };
 #endif
 
+#ifndef AF_INET6
+#define AF_INET6 3333
+#endif
+#ifndef PF_INET6
+#define PF_INET6 AF_INET6
+#endif
+
 #ifdef __cplusplus
 }
 #endif
index 4d8551d5ed4739d68eddba540e3fac382e28d1f7..18d6ca75cae3f6a7a9cade32ea240df1b7ac4251 100644 (file)
@@ -38,6 +38,8 @@
 #endif
 #include "event2/util.h"
 
+#include "ipv6-internal.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -213,9 +215,7 @@ struct sockaddr_storage {
        union {
                struct sockaddr ss_sa;
                struct sockaddr_in ss_sin;
-#ifdef _EVENT_HAVE_STRUCT_SOCKADDR_IN6
                struct sockaddr_in6 ss_sin6;
-#endif
                char ss_padding[128];
        } ss_union;
 };