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:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#if defined(DEBUG) && defined(_WIN32)
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <cassert>
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user