mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Fix include order and defines for Windows builds
This commit is contained in:
@@ -7,15 +7,16 @@
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
// Windows.h needs to be included first
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#undef CreateWindow
|
||||
|
||||
// Then the rest
|
||||
#include <shellapi.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <windows.h>
|
||||
#include <shellapi.h>
|
||||
#undef CreateWindow
|
||||
|
||||
#include <openrct2/audio/AudioContext.h>
|
||||
#include <openrct2/Context.h>
|
||||
#include <openrct2/OpenRCT2.h>
|
||||
|
||||
@@ -15,7 +15,11 @@
|
||||
#define _WIN32_WINNT 0x0600
|
||||
#endif // __MINGW32__
|
||||
|
||||
#include <sstream>
|
||||
// Windows.h needs to be included first
|
||||
#include <windows.h>
|
||||
#undef CreateWindow
|
||||
|
||||
// Then the rest
|
||||
#include <openrct2/common.h>
|
||||
#include <openrct2/core/Math.hpp>
|
||||
#include <openrct2/core/Path.hpp>
|
||||
@@ -23,8 +27,7 @@
|
||||
#include <openrct2/ui/UiContext.h>
|
||||
#include "UiContext.h"
|
||||
|
||||
#undef interface
|
||||
#include <windows.h>
|
||||
#include <sstream>
|
||||
#include <shlobj.h>
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL_syswm.h>
|
||||
|
||||
@@ -42,6 +42,8 @@
|
||||
#endif
|
||||
|
||||
#include <SDL2/SDL_opengl.h>
|
||||
// OpenRCT2: SDL_opengl.h includes windows.h, which defines the CreateWindow macro and causes conflicts
|
||||
#undef CreateWindow
|
||||
|
||||
#ifdef OPENGL_NO_LINK
|
||||
|
||||
|
||||
@@ -7,25 +7,24 @@
|
||||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdarg>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "../common.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "../Version.h"
|
||||
#include "../common.h"
|
||||
#include "Console.hpp"
|
||||
#include "Diagnostics.hpp"
|
||||
#include "Guard.hpp"
|
||||
#include "String.hpp"
|
||||
|
||||
void openrct2_assert_fwd(bool expression, const char * message, ...)
|
||||
#include <cassert>
|
||||
#include <cstdarg>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
||||
void openrct2_assert_fwd(bool expression, const char* message, ...)
|
||||
{
|
||||
va_list va;
|
||||
va_start(va, message);
|
||||
|
||||
@@ -9,8 +9,11 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <memory>
|
||||
// Windows.h needs to be included first
|
||||
#include <windows.h>
|
||||
|
||||
// Then the rest
|
||||
#include <memory>
|
||||
#include <datetimeapi.h>
|
||||
#include <shlobj.h>
|
||||
#undef GetEnvironmentVariable
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
#define _WIN32_WINNT 0x0600
|
||||
#endif // __MINGW32__
|
||||
|
||||
#include "../common.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#undef interface
|
||||
// Windows.h needs to be included first
|
||||
#include <windows.h>
|
||||
|
||||
// Then the rest
|
||||
#include <lmcons.h>
|
||||
#include <psapi.h>
|
||||
#include <shlobj.h>
|
||||
|
||||
2
src/openrct2/thirdparty/linenoise.hpp
vendored
2
src/openrct2/thirdparty/linenoise.hpp
vendored
@@ -131,6 +131,8 @@
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
// OpenRCT2: Windows.h defines `interface` too without checking if it exists already, so we we have to undefine it first
|
||||
#undef interface
|
||||
#include <windows.h>
|
||||
#include <io.h>
|
||||
#ifndef STDIN_FILENO
|
||||
|
||||
Reference in New Issue
Block a user