Skip to content

Commit d436502

Browse files
committedApr 14, 2014
Fix problem with newer MinGW runtimes
1 parent dcafad2 commit d436502

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed
 

‎src/porting.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2323
See comments in porting.h
2424
*/
2525

26+
#include "porting.h"
27+
2628
#if defined(__APPLE__)
2729
#include <mach-o/dyld.h>
2830
#include "CoreFoundation/CoreFoundation.h"
@@ -37,7 +39,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
3739
#include <sys/utsname.h>
3840
#endif
3941

40-
#include "porting.h"
4142
#include "config.h"
4243
#include "debug.h"
4344
#include "filesys.h"

‎src/porting.h

+8-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2424
#ifndef PORTING_HEADER
2525
#define PORTING_HEADER
2626

27+
#ifdef _WIN32
28+
#ifdef _WIN32_WINNT
29+
#undef _WIN32_WINNT
30+
#endif
31+
#define _WIN32_WINNT 0x0501 // We need to do this before any other headers
32+
// because those might include sdkddkver.h which defines _WIN32_WINNT if not already set
33+
#endif
34+
2735
#include <string>
2836
#include "irrlichttypes.h" // u32
2937
#include "debug.h"
@@ -42,9 +50,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
4250
//#define ALIGNOF(type) offsetof (alignment_trick<type>, member)
4351

4452
#ifdef _WIN32
45-
#ifndef _WIN32_WINNT
46-
#define _WIN32_WINNT 0x0501
47-
#endif
4853
#include <windows.h>
4954

5055
#define sleep_ms(x) Sleep(x)

0 commit comments

Comments
 (0)
Please sign in to comment.