netdb.h: Define AI_V4MAPPED, AI_ALL, AI_ADDRCONFIG when needed.
authorSimon Josefsson <simon@josefsson.org>
Wed, 17 Feb 2010 08:19:03 +0000 (09:19 +0100)
committerSimon Josefsson <simon@josefsson.org>
Wed, 17 Feb 2010 08:19:03 +0000 (09:19 +0100)
ChangeLog
lib/netdb.in.h

index 1609f879c79d28d48f6d01c9dab3e313ee174a43..b3d08538549f6f63c388c4a4b3ee37dd617e672b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-17  Simon Josefsson  <simon@josefsson.org>
+
+       * lib/netdb.in.h (AI_V4MAPPED, AI_ALL, AI_ADDRCONFIG): Define to 0
+       if not provided by the system's netdb.h.  Reported by
+       ludo@gnu.org (Ludovic Courtès).
+
 2010-02-15  Jim Meyering  <meyering@redhat.com>
 
        maint.mk: mark syntax-check sc_*.m rules as .PHONY
index 6f3695bd876705f6dfe1d5d33fd1d33e5bf28024..def9b5f799a06357e6fae35a4ff11514bde3af72 100644 (file)
@@ -74,18 +74,24 @@ struct addrinfo
 # endif
 
 # if 0
-/* The commented out definitions below are not yet implemented in the
-   GNULIB getaddrinfo() replacement, so are not yet needed and may, in fact,
-   cause conflicts on systems with a getaddrinfo() function which does not
-   define them.
-
-   If they are restored, be sure to protect the definitions with #ifndef.  */
 #  define AI_NUMERICHOST        0x0004  /* Don't use name resolution.  */
-#  define AI_V4MAPPED   0x0008  /* IPv4 mapped addresses are acceptable.  */
-#  define AI_ALL                0x0010  /* Return IPv4 mapped and IPv6 addresses.  */
-#  define AI_ADDRCONFIG 0x0020  /* Use configuration of this host to choose
-                                   returned address type..  */
-# endif /* 0 */
+# endif
+
+/* These symbolic constants are required to be present by POSIX, but
+   our getaddrinfo replacement doesn't use them (yet).  Setting them
+   to 0 on systems that doesn't have them avoids causing problems for
+   system getaddrinfo implementations that would be confused by
+   unknown values.  */
+# ifndef AI_V4MAPPED
+#  define AI_V4MAPPED    0 /* 0x0008: IPv4 mapped addresses are acceptable.  */
+# endif
+# ifndef AI_ALL
+#  define AI_ALL         0 /* 0x0010: Return IPv4 mapped and IPv6 addresses. */
+# endif
+# ifndef AI_ADDRCONFIG
+#  define AI_ADDRCONFIG  0 /* 0x0020: Use configuration of this host to choose
+                                      returned address type..  */
+# endif
 
 /* Error values for `getaddrinfo' function.  */
 # ifndef EAI_BADFLAGS