1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

build: Remove check for broken ss_family

This only seemed to affect ancient AIX systems.
This commit is contained in:
Nick Wellnhofer 2022-09-05 23:16:23 +02:00
parent c63b2692c9
commit a41878bd4c
4 changed files with 5 additions and 68 deletions

View File

@ -139,11 +139,6 @@ if (NOT MSVC)
set(ATTRIBUTE_DESTRUCTOR "__attribute__((destructor))")
endif()
check_include_files(arpa/inet.h HAVE_ARPA_INET_H)
check_struct_has_member("struct sockaddr_storage" ss_family "sys/socket.h" HAVE_SS_FAMILY)
check_struct_has_member("struct sockaddr_storage" __ss_family "sys/socket.h" HAVE_BROKEN_SS_FAMILY)
if(HAVE_BROKEN_SS_FAMILY)
set(ss_family __ss_family)
endif()
check_function_exists(class HAVE_CLASS)
check_include_files(dlfcn.h HAVE_DLFCN_H)
check_library_exists(dl dlopen "" HAVE_DLOPEN)

View File

@ -7,9 +7,6 @@
/* Define to 1 if you have the <arpa/inet.h> header file. */
#cmakedefine HAVE_ARPA_INET_H 1
/* Whether struct sockaddr::__ss_family exists */
#cmakedefine HAVE_BROKEN_SS_FAMILY 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#cmakedefine HAVE_DLFCN_H 1
@ -149,9 +146,6 @@
#define below would cause a syntax error. */
#cmakedefine _UINT32_T @_UINT32_T@
/* ss_family is not defined here, use __ss_family instead */
#cmakedefine ss_family @ss_family@
/* Define to the type of an unsigned integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
#cmakedefine uint32_t @uint32_t@

View File

@ -390,14 +390,13 @@ AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length
dnl
dnl Checking for availability of IPv6
dnl
AC_MSG_CHECKING([whether to enable IPv6])
AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes)
if test "$with_minimum" = "yes"
then
enable_ipv6=no
fi
if test $enable_ipv6 = yes; then
have_ipv6=no
AC_MSG_CHECKING([whether to enable IPv6])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef _WIN32
#include <winsock2.h>
@ -411,56 +410,11 @@ if test $enable_ipv6 = yes; then
struct sockaddr_storage ss;
socket(AF_INET6, SOCK_STREAM, 0);
getaddrinfo(0, 0, 0, 0);
]])],
have_ipv6=yes,
have_ipv6=no
)
AC_MSG_RESULT($have_ipv6)
if test $have_ipv6 = yes; then
]])], [
AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
have_broken_ss_family=no
dnl *********************************************************************
dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have
dnl a ss_family member, but rather __ss_family. Let's detect that
dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these
dnl platforms. However, we should only do this if ss_family is not
dnl present.
dnl ********************************************************************
AC_MSG_CHECKING([struct sockaddr::ss_family])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
# include <sys/socket.h>
]], [[
struct sockaddr_storage ss ;
ss.ss_family = 0 ;
]])],
have_ss_family=yes,
have_ss_family=no
)
AC_MSG_RESULT($have_ss_family)
if test x$have_ss_family = xno ; then
AC_MSG_CHECKING([broken struct sockaddr::ss_family])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
# include <sys/socket.h>
]], [[
struct sockaddr_storage ss ;
ss.__ss_family = 0 ;
]])],
have_broken_ss_family=yes,
have_broken_ss_family=no
)
AC_MSG_RESULT($have_broken_ss_family)
if test x$have_broken_ss_family = xyes ; then
AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [],
[Whether struct sockaddr::__ss_family exists])
AC_DEFINE(ss_family, __ss_family,
[ss_family is not defined here, use __ss_family instead])
else
AC_MSG_WARN(ss_family and __ss_family not found)
fi
fi
fi
AC_MSG_RESULT([yes])], [
AC_MSG_RESULT([no])]
)
fi
dnl

View File

@ -78,12 +78,6 @@
#define closesocket(s) close(s)
#endif
#ifdef _AIX
#ifdef HAVE_BROKEN_SS_FAMILY
#define ss_family __ss_family
#endif
#endif
#ifndef XML_SOCKLEN_T
#define XML_SOCKLEN_T unsigned int
#endif