From 713c254d21449e73b2877d6f69ee6c41aa56f182 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 24 Jan 2011 18:55:10 -0500 Subject: [PATCH] Try to build correctly on platforms with no IPv6 support --- ipv6-internal.h | 9 +++++++++ util-internal.h | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ipv6-internal.h b/ipv6-internal.h index 7d6fb736..1f272a0d 100644 --- a/ipv6-internal.h +++ b/ipv6-internal.h @@ -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 diff --git a/util-internal.h b/util-internal.h index 4d8551d5..18d6ca75 100644 --- a/util-internal.h +++ b/util-internal.h @@ -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; };