1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Fix Windows build; use WIN32_LEAN_AND_MEAN in more places

This commit is contained in:
Aaron van Geffen
2025-11-07 21:14:58 +01:00
committed by GitHub
parent a8e9a6b385
commit 49ef6768c5
11 changed files with 47 additions and 15 deletions

View File

@@ -8,6 +8,9 @@
*****************************************************************************/
// Windows.h needs to be included first
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
// Enable visual styles

View File

@@ -24,12 +24,17 @@
#include <tuple>
// clang-format off
// CNG: Cryptography API: Next Generation (CNG)
// available in Windows Vista onwards.
#include <windows.h>
#include <wincrypt.h>
#include <bcrypt.h>
constexpr bool NT_SUCCESS(NTSTATUS status) {return status >= 0;}
// windows.h needs to be included first
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
// CNG: Cryptography API: Next Generation (CNG)
// available in Windows Vista onwards.
#include <wincrypt.h>
#include <bcrypt.h>
constexpr bool NT_SUCCESS(NTSTATUS status) {return status >= 0;}
// clang-format on
using namespace OpenRCT2::Crypt;

View File

@@ -8,6 +8,9 @@
*****************************************************************************/
#if defined(DEBUG) && defined(_WIN32)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#endif

View File

@@ -8,6 +8,9 @@
*****************************************************************************/
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#else
#include <sys/stat.h>

View File

@@ -8,6 +8,9 @@
*****************************************************************************/
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#elif defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
#include <dirent.h>

View File

@@ -15,6 +15,9 @@
#include <stdexcept>
#ifdef _WIN32
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#elif defined(__linux__)
#include <chrono>

View File

@@ -8,7 +8,9 @@
*****************************************************************************/
#ifdef _WIN32
#include <cassert>
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#endif

View File

@@ -17,6 +17,10 @@
#include <cstdio>
#include <stdexcept>
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <winhttp.h>

View File

@@ -27,6 +27,9 @@
#include <unicode/unistr.h>
#include <unicode/utypes.h>
#else
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#endif

View File

@@ -26,6 +26,9 @@
#ifdef _WIN32
#pragma comment(lib, "Ws2_32.lib")
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
// winsock2 must be included before windows.h
#include <winsock2.h>
#include <ws2tcpip.h>

View File

@@ -13,27 +13,27 @@
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include "../Diagnostic.h"
#include <cassert>
// clang-format off
#include <windows.h>
// Then the rest
#include "../Version.h"
#include <datetimeapi.h>
#include <lmcons.h>
#include <memory>
#include <shlobj.h>
// clang-format on
#undef GetEnvironmentVariable
#undef small
#include "Platform.h"
#include "../Date.h"
#include "../Diagnostic.h"
#include "../OpenRCT2.h"
#include "../Version.h"
#include "../core/Path.hpp"
#include "../core/String.hpp"
#include "../localisation/Language.h"
#include "Platform.h"
#include <cassert>
#include <cstring>
#include <format>
#include <iterator>