Only use AI_NUMERICHOST if it is #define'd

It isn't using GNU libc 2.0.7, for example ...
This commit is contained in:
Alexander Barton 2011-11-06 14:13:49 +01:00
parent 60812b6fdf
commit a7911e35af
1 changed files with 2 additions and 0 deletions

View File

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