From 2213961e8f53e11763a0cae400e1a3669e861763 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Thu, 8 Nov 2007 01:10:34 +0000 Subject: [PATCH] Add back a define of "struct sockaddr_storage" for systems that don't have it. --- configure.in | 2 ++ lib/addrinfo.h | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 8cdbef1f..bffe367e 100644 --- a/configure.in +++ b/configure.in @@ -436,6 +436,8 @@ AC_CHECK_FUNCS(inet_ntop, , [AC_LIBOBJ(lib/inet_ntop)]) AC_CHECK_FUNCS(inet_pton, , [AC_LIBOBJ(lib/inet_pton)]) AC_HAVE_TYPE([struct addrinfo], [#include ]) +AC_HAVE_TYPE([struct sockaddr_storage], [#include +#include ]) # Irix 6.5 has getaddrinfo but not the corresponding defines, so use # builtin getaddrinfo if one of the defines don't exist diff --git a/lib/addrinfo.h b/lib/addrinfo.h index f3899e57..ee9f6724 100644 --- a/lib/addrinfo.h +++ b/lib/addrinfo.h @@ -124,7 +124,6 @@ TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. #endif #ifndef HAVE_STRUCT_ADDRINFO - struct addrinfo { int ai_flags; @@ -136,8 +135,15 @@ struct addrinfo char *ai_canonname; struct addrinfo *ai_next; }; -#endif /* HAVE_STRUCT_ADDRINFO */ +#endif /* !HAVE_STRUCT_ADDRINFO */ +#ifndef HAVE_STRUCT_SOCKADDR_STORAGE +struct sockaddr_storage { + unsigned short ss_family; + unsigned long ss_align; + char ss_padding[128 - sizeof (unsigned long)]; +}; +#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */ #ifndef HAVE_GETADDRINFO @@ -169,6 +175,6 @@ extern const char *gai_strerror(int errcode); extern int getnameinfo(const struct sockaddr * sa, socklen_t salen, char *node, size_t nodelen, char *service, size_t servicelen, int flags); -#endif /* HAVE_GETADDRINFO */ +#endif /* !HAVE_GETADDRINFO */ #endif /* ADDRINFO_H */ -- 2.34.1