summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Stringer <joe@wand.net.nz>2019-10-04 22:50:33 -0700
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-10-07 21:36:00 +0200
commitb4f1056097fda5a6023437b84bc6382943075fcb (patch)
tree1b5e2b0b57d52527617c46349503c460096c32ba
parent51f8c8a568158dcf164c0cbe389123fa9b6b190c (diff)
downloadopenttd-b4f1056097fda5a6023437b84bc6382943075fcb.tar.xz
Fix: [Cygwin] Fix missing AI_ADDRCONFIG declaration
Fixes the following complaints: src/network/core/address.cpp: In member function 'const sockaddr_storage* NetworkAddress::GetAddress()': src/network/core/address.cpp:134:55: error: 'AI_ADDRCONFIG' was not declared in this scope this->Resolve(this->address.ss_family, SOCK_STREAM, AI_ADDRCONFIG, nullptr, ResolveLoopProc); Signed-off-by: Joe Stringer <joe@wand.net.nz>
-rw-r--r--src/network/core/os_abstraction.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/network/core/os_abstraction.h b/src/network/core/os_abstraction.h
index ef5c0f2ab..df4bed425 100644
--- a/src/network/core/os_abstraction.h
+++ b/src/network/core/os_abstraction.h
@@ -31,6 +31,11 @@
/* Windows has some different names for some types */
typedef unsigned long in_addr_t;
+/* Handle cross-compilation with --build=*-*-cygwin --host=*-*-mingw32 */
+#if defined(__MINGW32__) && !defined(AI_ADDRCONFIG)
+# define AI_ADDRCONFIG 0x00000400
+#endif
+
#if !(defined(__MINGW32__) || defined(__CYGWIN__))
/* Windows has some different names for some types */
typedef SSIZE_T ssize_t;