From ed53dbd387217ee33db1cf5148355ebd5d81cb33 Mon Sep 17 00:00:00 2001 From: jorton Date: Mon, 29 Sep 2003 16:10:08 +0000 Subject: For platforms which have "struct sockaddr_stroage", allow apr_sockaddr_t to be extended in the future whilst retaining binary compatibility across builds with and without IPv6 enabled. * build/apr_network.m4 (APR_CHECK_SOCKADDR_STORAGE): New macro. * configure.in: Use it. * include/apr.h.in: Define APR_HAVE_SA_STORAGE. * include/apr_network_io.h: Add a "struct sockaddr_storage" field to the 'sa' union in apr_sockaddr_t. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64666 13f79535-47bb-0310-9956-ffa450edef68 --- build/apr_network.m4 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'build/apr_network.m4') diff --git a/build/apr_network.m4 b/build/apr_network.m4 index 691ef2f6a..7f7fbaa95 100644 --- a/build/apr_network.m4 +++ b/build/apr_network.m4 @@ -640,6 +640,26 @@ else fi ]) +AC_DEFUN(APR_CHECK_SOCKADDR_STORAGE,[ +AC_CACHE_CHECK(for sockaddr_storage, apr_cv_define_sockaddr_storage,[ +AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +],[struct sockaddr_storage sa;], +[apr_cv_define_sockaddr_storage=yes], +[apr_cv_define_sockaddr_storage=no])]) + +if test "$apr_cv_define_sockaddr_storage" = "yes"; then + have_sa_storage=1 +else + have_sa_storage=0 +fi +AC_SUBST(have_sa_storage) +]) AC_DEFUN(APR_CHECK_SOCKADDR_IN6,[ AC_CACHE_CHECK(for sockaddr_in6, ac_cv_define_sockaddr_in6,[ -- cgit v1.2.1