diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index f6b71a74bd..802a5c9752 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -7,9 +7,6 @@ /** @file network_chat_gui.cpp GUI for handling chat messages. */ -#include /* va_list */ -#include - #include "../stdafx.h" #include "../strings_func.h" #include "../blitter/factory.hpp" @@ -28,6 +25,9 @@ #include "table/strings.h" +#include /* va_list */ +#include + #include "../safeguards.h" /** The draw buffer must be able to contain the chat message, client name and the "[All]" message, diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index a03d669966..1fb7726e8f 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -45,6 +45,7 @@ #include "../error.h" #include "../scope.h" #include +#include #include #ifdef __EMSCRIPTEN__ # include diff --git a/src/script/api/script_date.cpp b/src/script/api/script_date.cpp index a5870c332e..78a30bcca1 100644 --- a/src/script/api/script_date.cpp +++ b/src/script/api/script_date.cpp @@ -7,12 +7,13 @@ /** @file script_date.cpp Implementation of ScriptDate. */ -#include #include "../../stdafx.h" #include "script_date.hpp" #include "../../date_func.h" #include "../../settings_type.h" +#include + #include "../../safeguards.h" /* static */ bool ScriptDate::IsValidDate(Date date) diff --git a/src/script/squirrel.cpp b/src/script/squirrel.cpp index 3d4e599abf..7fd5bef601 100644 --- a/src/script/squirrel.cpp +++ b/src/script/squirrel.cpp @@ -7,8 +7,6 @@ /** @file squirrel.cpp the implementation of the Squirrel class. It handles all Squirrel-stuff and gives a nice API back to work with. */ -#include -#include #include "../stdafx.h" #include "../debug.h" #include "squirrel_std.hpp" @@ -21,6 +19,9 @@ #include <../squirrel/sqvm.h> #include "../core/alloc_func.hpp" +#include +#include + /** * In the memory allocator for Squirrel we want to directly use malloc/realloc, so when the OS * does not have enough memory the game does not go into unrecoverable error mode and kill the diff --git a/src/stdafx.h b/src/stdafx.h index b55b031af0..a3d7249400 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -10,6 +10,15 @@ #ifndef STDAFX_H #define STDAFX_H +#if defined(_WIN32) + /* MinGW defaults to Windows 7 if none of these are set, and they must be set before any MinGW header is included */ +# define NTDDI_VERSION NTDDI_WINXP // Windows XP +# define _WIN32_WINNT 0x501 // Windows XP +# define _WIN32_WINDOWS 0x501 // Windows XP +# define WINVER 0x0501 // Windows XP +# define _WIN32_IE_ 0x0600 // 6.0 (XP+) +#endif + #ifdef _MSC_VER /* Stop Microsoft (and clang-cl) compilers from complaining about potentially-unsafe/potentially-non-standard functions */ # define _CRT_SECURE_NO_DEPRECATE @@ -154,12 +163,6 @@ /* Stuff for MSVC */ #if defined(_MSC_VER) # pragma once -# define NTDDI_VERSION NTDDI_WINXP // Windows XP -# define _WIN32_WINNT 0x501 // Windows XP -# define _WIN32_WINDOWS 0x501 // Windows XP -# define WINVER 0x0501 // Windows XP -# define _WIN32_IE_ 0x0600 // 6.0 (XP+) - # define NOMINMAX // Disable min/max macros in windows.h. # pragma warning(disable: 4244) // 'conversion' conversion from 'type1' to 'type2', possible loss of data