summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Triplett <josh@freedesktop.org>2006-11-20 22:26:40 -0800
committerJosh Triplett <josh@freedesktop.org>2006-11-20 22:26:40 -0800
commit4a928de402a6e69886921fe428bbffb909c6405e (patch)
tree3bc85f51c315ac7161aa20710c9d351a43cbbb45
parent907f8c8c4906cbd2352f3bbddfe144ad81a2cfa8 (diff)
Only use AI_NUMERICSERV if defined.
-rw-r--r--src/xcb_util.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/xcb_util.c b/src/xcb_util.c
index 587cb3a..ef8300f 100644
--- a/src/xcb_util.c
+++ b/src/xcb_util.c
@@ -176,8 +176,11 @@ static int _xcb_open_decnet(const char *host, const unsigned short port)
static int _xcb_open_tcp(char *host, const unsigned short port)
{
int fd = -1;
- struct addrinfo hints = { AI_ADDRCONFIG | AI_NUMERICSERV, AF_UNSPEC,
- SOCK_STREAM };
+ struct addrinfo hints = { AI_ADDRCONFIG
+#ifdef AI_NUMERICSERV
+ | AI_NUMERICSERV
+#endif
+ , AF_UNSPEC, SOCK_STREAM };
char service[6]; /* "65535" with the trailing '\0' */
struct addrinfo *results, *addr;
char *bracket;