summaryrefslogtreecommitdiffstats
path: root/gl/m4/getaddrinfo.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/getaddrinfo.m4')
-rw-r--r--gl/m4/getaddrinfo.m428
1 files changed, 21 insertions, 7 deletions
diff --git a/gl/m4/getaddrinfo.m4 b/gl/m4/getaddrinfo.m4
index 2931d526..8a63600b 100644
--- a/gl/m4/getaddrinfo.m4
+++ b/gl/m4/getaddrinfo.m4
@@ -1,6 +1,6 @@
1# getaddrinfo.m4 1# getaddrinfo.m4
2# serial 38 2# serial 39
3dnl Copyright (C) 2004-2025 Free Software Foundation, Inc. 3dnl Copyright (C) 2004-2026 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -90,7 +90,7 @@ int getaddrinfo (const char *, const char *, const struct addrinfo *, struct add
90 fi 90 fi
91 fi 91 fi
92 if test $HAVE_GETADDRINFO != 0; then 92 if test $HAVE_GETADDRINFO != 0; then
93 AC_CACHE_CHECK([whether getaddrinfo supports AI_NUMERICSERV], 93 AC_CACHE_CHECK([whether getaddrinfo supports AI_NUMERICHOST and AI_NUMERICSERV],
94 [gl_cv_func_getaddrinfo_works], 94 [gl_cv_func_getaddrinfo_works],
95 [AC_RUN_IFELSE( 95 [AC_RUN_IFELSE(
96 [AC_LANG_PROGRAM([[ 96 [AC_LANG_PROGRAM([[
@@ -107,16 +107,30 @@ int getaddrinfo (const char *, const char *, const struct addrinfo *, struct add
107#include <stddef.h> 107#include <stddef.h>
108#include <string.h> 108#include <string.h>
109 ]], [[ 109 ]], [[
110 struct addrinfo hints; 110 int result = 0;
111 struct addrinfo *ai; 111 struct addrinfo *ai;
112 memset (&hints, 0, sizeof (hints)); 112 {
113 hints.ai_flags = AI_NUMERICSERV; 113 struct addrinfo hints;
114 return getaddrinfo ("www.gnu.org", "http", &hints, &ai) != EAI_NONAME; 114 memset (&hints, 0, sizeof (hints));
115 hints.ai_flags = AI_NUMERICHOST;
116 if (getaddrinfo ("www.gnu.org", "http", &hints, &ai) != EAI_NONAME)
117 result |= 1;
118 }
119 {
120 struct addrinfo hints;
121 memset (&hints, 0, sizeof (hints));
122 hints.ai_flags = AI_NUMERICSERV;
123 if (getaddrinfo ("www.gnu.org", "http", &hints, &ai) != EAI_NONAME)
124 result |= 2;
125 }
126 return result;
115 ]]) 127 ]])
116 ], 128 ],
117 [gl_cv_func_getaddrinfo_works=yes], 129 [gl_cv_func_getaddrinfo_works=yes],
118 [gl_cv_func_getaddrinfo_works=no], 130 [gl_cv_func_getaddrinfo_works=no],
119 [case "$host_os" in 131 [case "$host_os" in
132 # Guess no on Solaris.
133 solaris*) gl_cv_func_getaddrinfo_works="guessing no" ;;
120 # Guess no on native Windows. 134 # Guess no on native Windows.
121 mingw* | windows*) gl_cv_func_getaddrinfo_works="guessing no" ;; 135 mingw* | windows*) gl_cv_func_getaddrinfo_works="guessing no" ;;
122 # Guess yes otherwise. 136 # Guess yes otherwise.