Only use AI_NUMERICHOST if it is #define'd
authorAlexander Barton <alex@barton.de>
Sun, 6 Nov 2011 13:13:49 +0000 (14:13 +0100)
committerAlexander Barton <alex@barton.de>
Sun, 6 Nov 2011 13:13:49 +0000 (14:13 +0100)
It isn't using GNU libc 2.0.7, for example ...

src/ipaddr/ng_ipaddr.c

index a47a40d2a245bc0856ff03a853a66606ba1b3e00..05ef6ecb19263f9b602fcbf7d46f3c7a51ad1150 100644 (file)
@@ -32,7 +32,9 @@ ng_ipaddr_init(ng_ipaddr_t *addr, const char *ip_str, UINT16 port)
        assert(ip_str);
 
        memset(&hints, 0, sizeof(hints));
+#ifdef AI_NUMERICHOST
        hints.ai_flags = AI_NUMERICHOST;
+#endif
 #ifndef WANT_IPV6      /* do not convert ipv6 addresses */
        hints.ai_family = AF_INET;
 #endif