]> Savannah Git Hosting - gnulib.git/commitdiff
netdb-h: Ensure AI_NUMERICHOST and AI_NUMERICSERV are defined.
authorBruno Haible <bruno@clisp.org>
Wed, 12 Feb 2025 17:43:59 +0000 (18:43 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 12 Feb 2025 17:49:39 +0000 (18:49 +0100)
* lib/netdb.in.h (AI_NUMERICHOST): New macro.
* tests/test-netdb-h.c: Verify that AI_NUMERICHOST and AI_NUMERICSERV
are defined.
* doc/posix-headers/netdb.texi: Mention the platform support for
AI_NUMERICHOST and AI_NUMERICSERV.

ChangeLog
doc/posix-headers/netdb.texi
lib/netdb.in.h
tests/test-netdb-h.c

index 1ad2f6ed5b91ad878e0f177dff39575f834269fc..f842861f913e10596e0d8a7e1ae542ef79df7f1e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2025-02-12  Bruno Haible  <bruno@clisp.org>
+
+       netdb-h: Ensure AI_NUMERICHOST and AI_NUMERICSERV are defined.
+       * lib/netdb.in.h (AI_NUMERICHOST): New macro.
+       * tests/test-netdb-h.c: Verify that AI_NUMERICHOST and AI_NUMERICSERV
+       are defined.
+       * doc/posix-headers/netdb.texi: Mention the platform support for
+       AI_NUMERICHOST and AI_NUMERICSERV.
+
 2025-02-11  Collin Funk  <collin.funk1@gmail.com>
 
        acl-permissions, file-has-acl: Depend on stdint-h for SIZE_MAX.
index aaaf05b23fc4b9f6ab5cf1334fc45a31e7422f79..be1d8491c38dd865b1811a6743625c4884ee5c86 100644 (file)
@@ -25,6 +25,14 @@ NetBSD 10.0.
 This header file does not define @code{AI_ADDRCONFIG} on some platforms:
 NetBSD 5.0.
 
+@item
+This header file does not define @code{AI_NUMERICHOST} on some platforms:
+HP-UX 11.11.
+
+@item
+This header file does not define @code{AI_NUMERICSERV} on some platforms:
+macOS 10.5, HP-UX 11.11, mingw.
+
 @item
 @c Defined in RFC 2553.
 This header file incorrectly defines @code{NI_MAXHOST} on some platforms:
index e8ba8f09787849edd8f8bb9a5378a5e1da518943..22059ea0440345e6dcb6b074c3fbea355739f7bf 100644 (file)
@@ -99,12 +99,11 @@ struct addrinfo
 # ifndef AI_CANONNAME
 #  define AI_CANONNAME  0x0002  /* Request for canonical name.  */
 # endif
-# ifndef AI_NUMERICSERV
-#  define AI_NUMERICSERV        0x0400  /* Don't use name resolution.  */
+# ifndef AI_NUMERICHOST
+#  define AI_NUMERICHOST 0x0004  /* Return numeric host address as name.  */
 # endif
-
-# if 0
-#  define AI_NUMERICHOST        0x0004  /* Don't use name resolution.  */
+# ifndef AI_NUMERICSERV
+#  define AI_NUMERICSERV 0x0400  /* Return service number as service name.  */
 # endif
 
 /* These symbolic constants are required to be present by POSIX, but
index cebd54855a70586a25ac4c1379b4a6c885dcaa0f..d2be1c8cc93489883f0741ecd1aff5aeef42674b 100644 (file)
@@ -29,6 +29,9 @@ struct hostent t1;
 /* Check that the 'socklen_t' type is defined.  */
 socklen_t t2;
 
+int ai1 = AI_NUMERICHOST;
+int ai2 = AI_NUMERICSERV;
+
 int
 main (void)
 {