From f463e612a1d6e573dedac2eb2425b042d64674f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20T=2E=20Listwon?= Date: Wed, 22 Sep 2021 22:37:26 +0200 Subject: [PATCH] Add missing WIN32_LEAN_AND_MEAN --- drivers/unix/ip_unix.cpp | 4 ++-- drivers/wasapi/audio_driver_wasapi.h | 1 + drivers/windows/dir_access_windows.cpp | 1 + drivers/windows/file_access_windows.cpp | 1 + drivers/winmidi/midi_driver_winmidi.h | 1 + drivers/xaudio2/audio_driver_xaudio2.h | 1 + modules/mono/utils/mono_reg_utils.cpp | 2 +- modules/mono/utils/path_utils.cpp | 1 + modules/mono/utils/thread_local.cpp | 1 + platform/uwp/os_uwp.cpp | 4 +--- platform/uwp/os_uwp.h | 1 + platform/windows/context_gl_windows.h | 1 + platform/windows/crash_handler_windows.h | 1 + platform/windows/key_mapping_windows.h | 2 +- platform/windows/os_windows.cpp | 4 +--- platform/windows/os_windows.h | 2 ++ platform/windows/power_windows.h | 1 + platform/windows/windows_terminal_logger.cpp | 1 + 18 files changed, 20 insertions(+), 10 deletions(-) diff --git a/drivers/unix/ip_unix.cpp b/drivers/unix/ip_unix.cpp index 07b0508faf2..211ad19835d 100644 --- a/drivers/unix/ip_unix.cpp +++ b/drivers/unix/ip_unix.cpp @@ -36,9 +36,9 @@ #ifdef WINDOWS_ENABLED #include -#include -// Needs to be included after winsocks2.h +#define WIN32_LEAN_AND_MEAN #include +#include #include #ifndef UWP_ENABLED #include diff --git a/drivers/wasapi/audio_driver_wasapi.h b/drivers/wasapi/audio_driver_wasapi.h index 6ed1160f609..ae8a1422e7d 100644 --- a/drivers/wasapi/audio_driver_wasapi.h +++ b/drivers/wasapi/audio_driver_wasapi.h @@ -39,6 +39,7 @@ #include #include +#define WIN32_LEAN_AND_MEAN #include class AudioDriverWASAPI : public AudioDriver { diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp index 2b65e99bd01..d05ec9e5d02 100644 --- a/drivers/windows/dir_access_windows.cpp +++ b/drivers/windows/dir_access_windows.cpp @@ -37,6 +37,7 @@ #include #include +#define WIN32_LEAN_AND_MEAN #include /* diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp index a955b1c2bde..50c4bd7d204 100644 --- a/drivers/windows/file_access_windows.cpp +++ b/drivers/windows/file_access_windows.cpp @@ -37,6 +37,7 @@ #include // _SH_DENYNO #include +#define WIN32_LEAN_AND_MEAN #include #include diff --git a/drivers/winmidi/midi_driver_winmidi.h b/drivers/winmidi/midi_driver_winmidi.h index 096d2ce6444..3195c05099a 100644 --- a/drivers/winmidi/midi_driver_winmidi.h +++ b/drivers/winmidi/midi_driver_winmidi.h @@ -37,6 +37,7 @@ #include "core/vector.h" #include +#define WIN32_LEAN_AND_MEAN #include #include diff --git a/drivers/xaudio2/audio_driver_xaudio2.h b/drivers/xaudio2/audio_driver_xaudio2.h index 4f19a8c4ba0..29eb115b53a 100644 --- a/drivers/xaudio2/audio_driver_xaudio2.h +++ b/drivers/xaudio2/audio_driver_xaudio2.h @@ -36,6 +36,7 @@ #include "servers/audio_server.h" #include +#define WIN32_LEAN_AND_MEAN #include #include #include diff --git a/modules/mono/utils/mono_reg_utils.cpp b/modules/mono/utils/mono_reg_utils.cpp index 1710e88a5cf..690eadb19cd 100644 --- a/modules/mono/utils/mono_reg_utils.cpp +++ b/modules/mono/utils/mono_reg_utils.cpp @@ -35,7 +35,7 @@ #include "core/os/os.h" -// Here, after os/os.h +#define WIN32_LEAN_AND_MEAN #include namespace MonoRegUtils { diff --git a/modules/mono/utils/path_utils.cpp b/modules/mono/utils/path_utils.cpp index faf340711cd..035675aa11f 100644 --- a/modules/mono/utils/path_utils.cpp +++ b/modules/mono/utils/path_utils.cpp @@ -36,6 +36,7 @@ #include "core/project_settings.h" #ifdef WINDOWS_ENABLED +#define WIN32_LEAN_AND_MEAN #include #define ENV_PATH_SEP ";" diff --git a/modules/mono/utils/thread_local.cpp b/modules/mono/utils/thread_local.cpp index e5bc45460bd..85e03c68480 100644 --- a/modules/mono/utils/thread_local.cpp +++ b/modules/mono/utils/thread_local.cpp @@ -31,6 +31,7 @@ #include "thread_local.h" #ifdef WINDOWS_ENABLED +#define WIN32_LEAN_AND_MEAN #include #else #include diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp index c2ffd15dc20..dc941eb49c5 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -28,9 +28,6 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -// Must include Winsock before windows.h (included by os_uwp.h) -#include "drivers/unix/net_socket_posix.h" - #include "os_uwp.h" #include "core/io/marshalls.h" @@ -38,6 +35,7 @@ #include "drivers/gles2/rasterizer_gles2.h" #include "drivers/gles3/rasterizer_gles3.h" #include "drivers/unix/ip_unix.h" +#include "drivers/unix/net_socket_posix.h" #include "drivers/windows/dir_access_windows.h" #include "drivers/windows/file_access_windows.h" #include "main/main.h" diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h index 4965b30e263..5f778159565 100644 --- a/platform/uwp/os_uwp.h +++ b/platform/uwp/os_uwp.h @@ -47,6 +47,7 @@ #include #include #include +#define WIN32_LEAN_AND_MEAN #include class OS_UWP : public OS { diff --git a/platform/windows/context_gl_windows.h b/platform/windows/context_gl_windows.h index d838c940442..7253d517cb4 100644 --- a/platform/windows/context_gl_windows.h +++ b/platform/windows/context_gl_windows.h @@ -38,6 +38,7 @@ #include "core/error_list.h" #include "core/os/os.h" +#define WIN32_LEAN_AND_MEAN #include typedef bool(APIENTRY *PFNWGLSWAPINTERVALEXTPROC)(int interval); diff --git a/platform/windows/crash_handler_windows.h b/platform/windows/crash_handler_windows.h index e1ec8e67879..5cdc6d3e056 100644 --- a/platform/windows/crash_handler_windows.h +++ b/platform/windows/crash_handler_windows.h @@ -31,6 +31,7 @@ #ifndef CRASH_HANDLER_WINDOWS_H #define CRASH_HANDLER_WINDOWS_H +#define WIN32_LEAN_AND_MEAN #include // Crash handler exception only enabled with MSVC diff --git a/platform/windows/key_mapping_windows.h b/platform/windows/key_mapping_windows.h index 54f5fee28b5..f393f2b2a0b 100644 --- a/platform/windows/key_mapping_windows.h +++ b/platform/windows/key_mapping_windows.h @@ -33,8 +33,8 @@ #include "core/os/keyboard.h" +#define WIN32_LEAN_AND_MEAN #include - #include class KeyMappingWindows { diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 6f0cfea9734..a815563b3d7 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -28,9 +28,6 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -// Must include Winsock before windows.h (included by os_windows.h) -#include "drivers/unix/net_socket_posix.h" - #include "os_windows.h" #include "core/io/marshalls.h" @@ -38,6 +35,7 @@ #include "core/version_generated.gen.h" #include "drivers/gles2/rasterizer_gles2.h" #include "drivers/gles3/rasterizer_gles3.h" +#include "drivers/unix/net_socket_posix.h" #include "drivers/windows/dir_access_windows.h" #include "drivers/windows/file_access_windows.h" #include "joypad_windows.h" diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 41b152123a4..c623523d72a 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -52,7 +52,9 @@ #include #include #include +#include #include +#define WIN32_LEAN_AND_MEAN #include #include // WinTab API diff --git a/platform/windows/power_windows.h b/platform/windows/power_windows.h index 751b81d3623..84ed048837f 100644 --- a/platform/windows/power_windows.h +++ b/platform/windows/power_windows.h @@ -35,6 +35,7 @@ #include "core/os/file_access.h" #include "core/os/os.h" +#define WIN32_LEAN_AND_MEAN #include class PowerWindows { diff --git a/platform/windows/windows_terminal_logger.cpp b/platform/windows/windows_terminal_logger.cpp index 616e878bb87..d0ac11981db 100644 --- a/platform/windows/windows_terminal_logger.cpp +++ b/platform/windows/windows_terminal_logger.cpp @@ -33,6 +33,7 @@ #ifdef WINDOWS_ENABLED #include +#define WIN32_LEAN_AND_MEAN #include void WindowsTerminalLogger::logv(const char *p_format, va_list p_list, bool p_err) {