diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-01-09 12:46:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-09 12:46:33 +0100 |
commit | 0e635b683b84417b0970218ce720bbc553205ca6 (patch) | |
tree | 58b69906768b6709e039ec1a806679f7d307f3a4 | |
parent | 74c63fc378982948db84108a663cc267cc3badb3 (diff) | |
parent | b24fe6879a2d26b530c1198ba7abb8cf2719f06c (diff) |
Merge pull request #7480 from godotengine/ip-mingw2-workaround2
Windows: Workaround missing includes in MinGW-w64 < 4
-rw-r--r-- | drivers/unix/ip_unix.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/unix/ip_unix.cpp b/drivers/unix/ip_unix.cpp index e75408e493..ffb37b4f59 100644 --- a/drivers/unix/ip_unix.cpp +++ b/drivers/unix/ip_unix.cpp @@ -42,7 +42,19 @@ #include <windows.h> #include <stdio.h> #ifndef UWP_ENABLED - #include <iphlpapi.h> + #if defined(__MINGW32__ ) && (!defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 4) + // MinGW-w64 on Ubuntu 12.04 (our Travis build env) has bugs in this code where + // some includes are missing in dependencies of iphlpapi.h for WINVER >= 0x0600 (Vista). + // We don't use this Vista code for now, so working it around by disabling it. + // MinGW-w64 >= 4.0 seems to be better judging by its headers. + #undef _WIN32_WINNT + #define _WIN32_WINNT 0x0501 // Windows XP, disable Vista API + #include <iphlpapi.h> + #undef _WIN32_WINNT + #define _WIN32_WINNT 0x0600 // Reenable Vista API + #else + #include <iphlpapi.h> + #endif // MINGW hack #endif #else #include <netdb.h> |