summaryrefslogtreecommitdiff
path: root/src/porting.h
diff options
context:
space:
mode:
authorSfan5 <sfan5@live.de>2014-04-14 18:03:28 +0200
committerSfan5 <sfan5@live.de>2014-04-14 20:09:42 +0200
commitd436502fa499255236350fc9204f9c508414704e (patch)
treeadf857a647ad396e71f6e2a0c2959c0c3a66c459 /src/porting.h
parentdcafad2f736aa9b7174bdf7313735d89b981e0c6 (diff)
downloadminetest-d436502fa499255236350fc9204f9c508414704e.tar.gz
minetest-d436502fa499255236350fc9204f9c508414704e.tar.bz2
minetest-d436502fa499255236350fc9204f9c508414704e.zip
Fix problem with newer MinGW runtimes
Diffstat (limited to 'src/porting.h')
-rw-r--r--src/porting.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/porting.h b/src/porting.h
index 9024570bd..aaabce4eb 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 <string>
#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<type>, member)
#ifdef _WIN32
- #ifndef _WIN32_WINNT
- #define _WIN32_WINNT 0x0501
- #endif
#include <windows.h>
#define sleep_ms(x) Sleep(x)