Try to build correctly on platforms with no IPv6 support

This commit is contained in:
Nick Mathewson 2011-01-24 18:55:10 -05:00
parent 9184563e49
commit 713c254d21
2 changed files with 11 additions and 2 deletions

View 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

View 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;
};