diff options
| author | Fabio Alessandrelli | 2016-10-28 23:11:53 +0200 |
|---|---|---|
| committer | Fabio Alessandrelli | 2016-12-11 18:12:46 +0100 |
| commit | 754e9aa60a8892cdd6c1d74a822f049f1c71d831 (patch) | |
| tree | ca3150ea446c3a5fc15a5be6b6feede00ec4c757 /drivers/unix/ip_unix.cpp | |
| parent | a2048efd724893569bb2fbf7c53edd96eab6a646 (diff) | |
| download | godot-754e9aa60a8892cdd6c1d74a822f049f1c71d831.tar.gz godot-754e9aa60a8892cdd6c1d74a822f049f1c71d831.tar.zst godot-754e9aa60a8892cdd6c1d74a822f049f1c71d831.zip | |
Diffstat (limited to 'drivers/unix/ip_unix.cpp')
| -rw-r--r-- | drivers/unix/ip_unix.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/unix/ip_unix.cpp b/drivers/unix/ip_unix.cpp index d6d1be339..e3d32618e 100644 --- a/drivers/unix/ip_unix.cpp +++ b/drivers/unix/ip_unix.cpp @@ -33,6 +33,13 @@ #include <string.h> #ifdef WINDOWS_ENABLED + // Workaround mingw missing flags! + #ifndef AI_ADDRCONFIG + #define AI_ADDRCONFIG 0x00000400 + #endif + #ifndef AI_V4MAPPED + #define AI_V4MAPPED 0x00000800 + #endif #ifdef WINRT_ENABLED #include <ws2tcpip.h> #include <winsock2.h> @@ -90,8 +97,10 @@ IP_Address IP_Unix::_resolve_hostname(const String& p_hostname, IP_Address::Addr hints.ai_family = AF_INET; } else if (p_type == IP_Address::TYPE_IPV6) { hints.ai_family = AF_INET6; + hints.ai_flags = 0; } else { hints.ai_family = AF_UNSPEC; + hints.ai_flags = (AI_V4MAPPED | AI_ADDRCONFIG); }; int s = getaddrinfo(p_hostname.utf8().get_data(), NULL, &hints, &result); |
