From d243f1f8feac1241a6d5be71964e9b9df5d06aa2 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Fri, 25 Apr 2014 17:29:59 +0200 Subject: [PATCH] configure: check if getaddrinfo() is available This allows disabling IPv6 support and keeping getaddrinfo(). --- configure | 6 ++++++ nameserv.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 7d91445..db02242 100755 --- a/configure +++ b/configure @@ -413,6 +413,12 @@ then fi fi +if test_code 'getaddrinfo()' 'sys/types.h sys/socket.h netdb.h' '' '' \ + 'return getaddrinfo(0, 0, 0, 0);' +then + add_def HAVE_GETADDRINFO +fi + timepps_h="" if [ $feat_pps = "1" ]; then if test_code '' 'sys/timepps.h' '' '' ''; then diff --git a/nameserv.c b/nameserv.c index 328212b..f8a4b63 100644 --- a/nameserv.c +++ b/nameserv.c @@ -46,7 +46,7 @@ DNS_SetAddressFamily(int family) DNS_Status DNS_Name2IPAddress(const char *name, IPAddr *addr) { -#ifdef HAVE_IPV6 +#ifdef HAVE_GETADDRINFO struct addrinfo hints, *res, *ai; int result;