From 5e16640ba388c2d060d2655b2ce3169580288e4c Mon Sep 17 00:00:00 2001 From: Per Inge Mathisen Date: Sun, 13 Dec 2009 20:25:00 +0000 Subject: [PATCH] Build fixes for netplay.c on OpenBSD, closes ticket:1180 git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8675 4a71c877-e1ca-e34f-864e-861f7616d084 --- lib/netplay/netplay.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/netplay/netplay.c b/lib/netplay/netplay.c index 048c61b09..8a1c247ef 100644 --- a/lib/netplay/netplay.c +++ b/lib/netplay/netplay.c @@ -49,6 +49,7 @@ # include # include # include +# include # include typedef int SOCKET; static const SOCKET INVALID_SOCKET = -1; @@ -1070,12 +1071,18 @@ static struct addrinfo* resolveHost(const char* host, unsigned int port) struct addrinfo* results; char* service; struct addrinfo hint; - int error; + int error, flags = 0; hint.ai_family = AF_UNSPEC; hint.ai_socktype = SOCK_STREAM; hint.ai_protocol = 0; - hint.ai_flags = (AI_V4MAPPED | AI_ADDRCONFIG); +#ifdef AI_V4MAPPED + flags |= AI_V4MAPPED; +#endif +#ifdef AI_ADDRCONFIG + flags |= AI_ADDRCONFIG; +#endif + hint.ai_flags = flags; hint.ai_addrlen = 0; hint.ai_addr = NULL; hint.ai_canonname = NULL;