Fix build on Windows

Use wrapper header over Windows.h to undefine far and near in a single place.
pull/3226/head
elsid 2 years ago
parent f99f818c0c
commit 0dcb1f5aac
No known key found for this signature in database
GPG Key ID: D27B8E8D10A2896B

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

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

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

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

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

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

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

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

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

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

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