1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-05-01 10:41:23 +00:00

Merge branch 'fix_windows_build' into 'master'

Fix build on Windows

See merge request OpenMW/openmw!1796
This commit is contained in:
psi29a 2022-04-25 06:38:33 +00:00
commit c930aabf17
11 changed files with 20 additions and 30 deletions

View file

@ -15,7 +15,7 @@
#include "model/world/data.hpp" #include "model/world/data.hpp"
#ifdef _WIN32 #ifdef _WIN32
#include <Windows.h> #include <components/windows.hpp>
#endif #endif
using namespace Fallback; using namespace Fallback;

View file

@ -9,10 +9,7 @@
#include "options.hpp" #include "options.hpp"
#if defined(_WIN32) #if defined(_WIN32)
#ifndef WIN32_LEAN_AND_MEAN #include <components/windows.hpp>
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
// makes __argc and __argv available on windows // makes __argc and __argv available on windows
#include <cstdlib> #include <cstdlib>
#endif #endif

View file

@ -3,10 +3,7 @@
#include <string> #include <string>
#undef WIN32_LEAN_AND_MEAN #include <components/windows.hpp>
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <components/crashcatcher/crashcatcher.hpp> #include <components/crashcatcher/crashcatcher.hpp>
namespace Crash namespace Crash

View file

@ -1,8 +1,6 @@
#include "windows_crashmonitor.hpp" #include "windows_crashmonitor.hpp"
#undef WIN32_LEAN_AND_MEAN #include <components/windows.hpp>
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <Psapi.h> #include <Psapi.h>
#include <DbgHelp.h> #include <DbgHelp.h>

View file

@ -1,9 +1,7 @@
#ifndef WINDOWS_CRASHMONITOR_HPP #ifndef WINDOWS_CRASHMONITOR_HPP
#define WINDOWS_CRASHMONITOR_HPP #define WINDOWS_CRASHMONITOR_HPP
#undef WIN32_LEAN_AND_MEAN #include <components/windows.hpp>
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <atomic> #include <atomic>
#include <unordered_map> #include <unordered_map>

View file

@ -1,9 +1,7 @@
#ifndef WINDOWS_CRASHSHM_HPP #ifndef WINDOWS_CRASHSHM_HPP
#define WINDOWS_CRASHSHM_HPP #define WINDOWS_CRASHSHM_HPP
#undef WIN32_LEAN_AND_MEAN #include <components/windows.hpp>
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
namespace Crash namespace Crash
{ {

View file

@ -8,9 +8,7 @@
#ifdef _WIN32 #ifdef _WIN32
#include <components/crashcatcher/windows_crashcatcher.hpp> #include <components/crashcatcher/windows_crashcatcher.hpp>
# undef WIN32_LEAN_AND_MEAN #include <components/windows.hpp>
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#endif #endif
namespace Debug namespace Debug

View file

@ -12,9 +12,7 @@
#include "debuglog.hpp" #include "debuglog.hpp"
#if defined _WIN32 && defined _DEBUG #if defined _WIN32 && defined _DEBUG
# undef WIN32_LEAN_AND_MEAN #include <components/windows.hpp>
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
#endif #endif
namespace Debug namespace Debug

View file

@ -19,7 +19,7 @@
#include <cstdio> #include <cstdio>
#elif FILE_API == FILE_API_POSIX #elif FILE_API == FILE_API_POSIX
#elif FILE_API == FILE_API_WIN32 #elif FILE_API == FILE_API_WIN32
#include <windows.h> #include <components/windows.hpp>
#else #else
#error Unsupported File API #error Unsupported File API
#endif #endif

View file

@ -25,10 +25,7 @@ namespace Misc
#elif defined(WIN32) #elif defined(WIN32)
#undef WIN32_LEAN_AND_MEAN #include <components/windows.hpp>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
namespace Misc namespace Misc
{ {

9
components/windows.hpp Normal file
View file

@ -0,0 +1,9 @@
#ifndef OPENMW_COMPONENTS_WINDOWS_H
#define OPENMW_COMPONENTS_WINDOWS_H
#include <Windows.h>
#undef far
#undef near
#endif