From d436502fa499255236350fc9204f9c508414704e Mon Sep 17 00:00:00 2001 From: Sfan5 Date: Mon, 14 Apr 2014 18:03:28 +0200 Subject: [PATCH] Fix problem with newer MinGW runtimes --- src/porting.cpp | 3 ++- src/porting.h | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/porting.cpp b/src/porting.cpp index b0a1843e..e7bef1d3 100644 --- a/src/porting.cpp +++ b/src/porting.cpp @@ -23,6 +23,8 @@ with this program; if not, write to the Free Software Foundation, Inc., See comments in porting.h */ +#include "porting.h" + #if defined(__APPLE__) #include #include "CoreFoundation/CoreFoundation.h" @@ -37,7 +39,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #endif -#include "porting.h" #include "config.h" #include "debug.h" #include "filesys.h" diff --git a/src/porting.h b/src/porting.h index 9024570b..aaabce4e 100644 --- a/src/porting.h +++ b/src/porting.h @@ -24,6 +24,14 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef PORTING_HEADER #define PORTING_HEADER +#ifdef _WIN32 + #ifdef _WIN32_WINNT + #undef _WIN32_WINNT + #endif + #define _WIN32_WINNT 0x0501 // We need to do this before any other headers + // because those might include sdkddkver.h which defines _WIN32_WINNT if not already set +#endif + #include #include "irrlichttypes.h" // u32 #include "debug.h" @@ -42,9 +50,6 @@ with this program; if not, write to the Free Software Foundation, Inc., //#define ALIGNOF(type) offsetof (alignment_trick, member) #ifdef _WIN32 - #ifndef _WIN32_WINNT - #define _WIN32_WINNT 0x0501 - #endif #include #define sleep_ms(x) Sleep(x) -- 2.30.2