Add HAVE_STRUCT_ADDRINFO, HAVE_STRUCT_IN6_ADDR, HAVE_STRUCT_SOCKADDR_IN6, HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN, HAVE_STRUCT_SOCKADDR_IN_SIN_LEN, HAVE_STRUCT_SOCKADDR_UN, HAVE_STRUCT_SOCKADDR_STORAGE, HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY, HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY, HAVE_STRUCT_LINGER (GH PR #34)

This commit is contained in:
Fred Helmesjö 2022-09-01 09:57:14 +02:00 committed by Boris Kolpackov
parent 13e255d98b
commit ad176f5bd4
10 changed files with 171 additions and 0 deletions

View File

@ -0,0 +1,20 @@
// HAVE_STRUCT_ADDRINFO : BUILD2_AUTOCONF_LIBC_VERSION
#ifndef BUILD2_AUTOCONF_LIBC_VERSION
# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included
#endif
#undef HAVE_STRUCT_ADDRINFO
/* Since Linux/glibc 2.4, OpenBSD 2.9, FreeBSD 3.5, NetBSD 1.5, and Mac OS
* (hard to tell but based on the manpages available online it looks like
* Tiger at the latest).
* NOTE: Assuming same as HAVE_GETADDRINFO
*/
#if BUILD2_AUTOCONF_GLIBC_PREREQ(2, 4) || \
BUILD2_AUTOCONF_OPENBSD_PREREQ(200106) || \
BUILD2_AUTOCONF_FREEBSD_PREREQ(3, 5) || \
BUILD2_AUTOCONF_NETBSD_PREREQ(1, 5) || \
defined(BUILD2_AUTOCONF_MACOS)
# define HAVE_STRUCT_ADDRINFO 1
#endif

View File

@ -0,0 +1,17 @@
// HAVE_STRUCT_IN6_ADDR : BUILD2_AUTOCONF_LIBC_VERSION
#ifndef BUILD2_AUTOCONF_LIBC_VERSION
# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included
#endif
#undef HAVE_STRUCT_IN6_ADDR
/* Since Linux/glibc 2.1, OpenBSD 2.9, FreeBSD 3.5, NetBSD 1.5, and Mac OS X
*/
#if BUILD2_AUTOCONF_GLIBC_PREREQ(2, 1) || \
BUILD2_AUTOCONF_FREEBSD_PREREQ(3, 5)|| \
BUILD2_AUTOCONF_OPENBSD_PREREQ(200106) || \
BUILD2_AUTOCONF_NETBSD_PREREQ(1, 5) || \
defined(BUILD2_AUTOCONF_MACOS)
# define HAVE_STRUCT_IN6_ADDR 1
#endif

View File

@ -0,0 +1,17 @@
// HAVE_STRUCT_LINGER : BUILD2_AUTOCONF_LIBC_VERSION
#ifndef BUILD2_AUTOCONF_LIBC_VERSION
# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included
#endif
#undef HAVE_STRUCT_LINGER
/* Since Linux/glibc 2.1, OpenBSD 2.9, FreeBSD 3.5, NetBSD 1.5, Mac OS X
*/
#if BUILD2_AUTOCONF_GLIBC_PREREQ(2, 1) || \
BUILD2_AUTOCONF_FREEBSD_PREREQ(3, 5) || \
BUILD2_AUTOCONF_OPENBSD_PREREQ(200106) || \
BUILD2_AUTOCONF_NETBSD_PREREQ(1, 5) || \
defined(BUILD2_AUTOCONF_MACOS)
# define HAVE_STRUCT_LINGER 1
#endif

View File

@ -0,0 +1,16 @@
// HAVE_STRUCT_SOCKADDR_IN6 : BUILD2_AUTOCONF_LIBC_VERSION
#ifndef BUILD2_AUTOCONF_LIBC_VERSION
# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included
#endif
#undef HAVE_STRUCT_SOCKADDR_IN6
/* Since OpenBSD ~4.2, FreeBSD ~7.0, NetBSD 2.1, Mac OS X 10.6
*/
#if BUILD2_AUTOCONF_OPENBSD_PREREQ(200705) || \
BUILD2_AUTOCONF_FREEBSD_PREREQ(7, 0) || \
BUILD2_AUTOCONF_NETBSD_PREREQ(2, 1) || \
BUILD2_AUTOCONF_MACOS_PREREQ(10, 6)
# define HAVE_STRUCT_SOCKADDR_IN6 1
#endif

View File

@ -0,0 +1,16 @@
// HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN : BUILD2_AUTOCONF_LIBC_VERSION
#ifndef BUILD2_AUTOCONF_LIBC_VERSION
# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included
#endif
#undef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
/* Since OpenBSD ~4.2, FreeBSD ~7.0, NetBSD 2.1, Mac OS X 10.6
*/
#if BUILD2_AUTOCONF_OPENBSD_PREREQ(200705) || \
BUILD2_AUTOCONF_FREEBSD_PREREQ(7, 0) || \
BUILD2_AUTOCONF_NETBSD_PREREQ(2, 1) || \
BUILD2_AUTOCONF_MACOS_PREREQ(10, 6)
# define HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN 1
#endif

View File

@ -0,0 +1,17 @@
// HAVE_STRUCT_SOCKADDR_IN_SIN_LEN : BUILD2_AUTOCONF_LIBC_VERSION
#ifndef BUILD2_AUTOCONF_LIBC_VERSION
# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included
#endif
#undef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
/* Since 4.3BSD (OpenBSD, FreeBSD, NetBSD, Mac OS X)
* 'The length member, sin_len, was added with 4.3BSD-Reno [..]'
*/
#if defined(__FreeBSD__) || \
defined(__OpenBSD__) || \
defined(__NetBSD__) || \
defined(BUILD2_AUTOCONF_MACOS)
# define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1
#endif

View File

@ -0,0 +1,17 @@
// HAVE_STRUCT_SOCKADDR_STORAGE : BUILD2_AUTOCONF_LIBC_VERSION
#ifndef BUILD2_AUTOCONF_LIBC_VERSION
# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included
#endif
#undef HAVE_STRUCT_SOCKADDR_STORAGE
/* Linux/glibc 2.1.1, Since 4.2BSD (~1983)
*/
#if BUILD2_AUTOCONF_GLIBC_PREREQ(2, 2) || \
defined(__FreeBSD__) || \
defined(__OpenBSD__) || \
defined(__NetBSD__) || \
defined(BUILD2_AUTOCONF_MACOS)
# define HAVE_STRUCT_SOCKADDR_STORAGE 1
#endif

View File

@ -0,0 +1,19 @@
// HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY : BUILD2_AUTOCONF_LIBC_VERSION
#ifndef BUILD2_AUTOCONF_LIBC_VERSION
# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included
#endif
#undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
/* Since Linux/glibc 2.3, OpenBSD >=2.7, FreeBSD >=4.0, NetBSD >=1.5, Mac OS X 10.0
* NOTE: RFC2553 (<1999) - defines __ss_len & __ss_family
* XNET draft (>1999) - defines ss_len & ss_family
*/
#if BUILD2_AUTOCONF_GLIBC_PREREQ(2, 3) || \
BUILD2_AUTOCONF_OPENBSD_PREREQ(200015) || \
BUILD2_AUTOCONF_FREEBSD_PREREQ(4, 0) || \
BUILD2_AUTOCONF_NETBSD_PREREQ(1, 5) || \
BUILD2_AUTOCONF_MACOS_PREREQ(10, 0)
# define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
#endif

View File

@ -0,0 +1,15 @@
// HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY : BUILD2_AUTOCONF_LIBC_VERSION
#ifndef BUILD2_AUTOCONF_LIBC_VERSION
# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included
#endif
#undef HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY
/* Since Linux/glibc <=2.2, OpenBSD <2.7, FreeBSD <4.0, NetBSD <1.5
* NOTE: RFC2553 (<1999) - defines __ss_len & __ss_family
* XNET draft (>1999) - defines ss_len & ss_family
*/
#if !BUILD2_AUTOCONF_GLIBC_PREREQ(2, 3)
# define HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY 1
#endif

View File

@ -0,0 +1,17 @@
// HAVE_STRUCT_SOCKADDR_UN : BUILD2_AUTOCONF_LIBC_VERSION
#ifndef BUILD2_AUTOCONF_LIBC_VERSION
# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included
#endif
#undef HAVE_STRUCT_SOCKADDR_UN
/* Linux/glibc 1.09, Since 4.4BSD (~1995)
*/
#if BUILD2_AUTOCONF_GLIBC_PREREQ(1, 09) || \
defined(__FreeBSD__) || \
defined(__OpenBSD__) || \
defined(__NetBSD__) || \
defined(BUILD2_AUTOCONF_MACOS)
# define HAVE_STRUCT_SOCKADDR_UN 1
#endif