summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/unix/ip_unix.cpp4
-rw-r--r--drivers/wasapi/audio_driver_wasapi.h1
-rw-r--r--drivers/windows/dir_access_windows.cpp1
-rw-r--r--drivers/windows/file_access_windows.cpp1
-rw-r--r--drivers/winmidi/midi_driver_winmidi.h1
-rw-r--r--drivers/xaudio2/audio_driver_xaudio2.h1
-rw-r--r--modules/mono/utils/mono_reg_utils.cpp2
-rw-r--r--modules/mono/utils/path_utils.cpp1
-rw-r--r--platform/uwp/os_uwp.cpp4
-rw-r--r--platform/uwp/os_uwp.h1
-rw-r--r--platform/windows/context_gl_windows.h1
-rw-r--r--platform/windows/crash_handler_windows.h1
-rw-r--r--platform/windows/display_server_windows.h1
-rw-r--r--platform/windows/key_mapping_windows.h2
-rw-r--r--platform/windows/os_windows.cpp4
-rw-r--r--platform/windows/os_windows.h2
-rw-r--r--platform/windows/vulkan_context_win.h2
-rw-r--r--platform/windows/windows_terminal_logger.cpp1
18 files changed, 21 insertions, 10 deletions
diff --git a/drivers/unix/ip_unix.cpp b/drivers/unix/ip_unix.cpp
index 8a880ab9c8..d32592e81a 100644
--- a/drivers/unix/ip_unix.cpp
+++ b/drivers/unix/ip_unix.cpp
@@ -36,9 +36,9 @@
#ifdef WINDOWS_ENABLED
#include <stdio.h>
-#include <winsock2.h>
-// Needs to be included after winsocks2.h
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
+#include <winsock2.h>
#include <ws2tcpip.h>
#ifndef UWP_ENABLED
#include <iphlpapi.h>
diff --git a/drivers/wasapi/audio_driver_wasapi.h b/drivers/wasapi/audio_driver_wasapi.h
index 312b6a6781..a19cd3da09 100644
--- a/drivers/wasapi/audio_driver_wasapi.h
+++ b/drivers/wasapi/audio_driver_wasapi.h
@@ -39,6 +39,7 @@
#include <audioclient.h>
#include <mmdeviceapi.h>
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
class AudioDriverWASAPI : public AudioDriver {
diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp
index ae781e9424..3e98e36d14 100644
--- a/drivers/windows/dir_access_windows.cpp
+++ b/drivers/windows/dir_access_windows.cpp
@@ -37,6 +37,7 @@
#include <stdio.h>
#include <wchar.h>
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
/*
diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp
index 775c999b15..035c44a28c 100644
--- a/drivers/windows/file_access_windows.cpp
+++ b/drivers/windows/file_access_windows.cpp
@@ -37,6 +37,7 @@
#include <share.h> // _SH_DENYNO
#include <shlwapi.h>
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <errno.h>
diff --git a/drivers/winmidi/midi_driver_winmidi.h b/drivers/winmidi/midi_driver_winmidi.h
index bb9a87d610..2f691489b3 100644
--- a/drivers/winmidi/midi_driver_winmidi.h
+++ b/drivers/winmidi/midi_driver_winmidi.h
@@ -37,6 +37,7 @@
#include "core/templates/vector.h"
#include <stdio.h>
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <mmsystem.h>
diff --git a/drivers/xaudio2/audio_driver_xaudio2.h b/drivers/xaudio2/audio_driver_xaudio2.h
index d3938a19d0..c1910d3f5d 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 <mmsystem.h>
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <wrl/client.h>
#include <xaudio2.h>
diff --git a/modules/mono/utils/mono_reg_utils.cpp b/modules/mono/utils/mono_reg_utils.cpp
index 6b616dd52d..d0a27b27c1 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 <windows.h>
namespace MonoRegUtils {
diff --git a/modules/mono/utils/path_utils.cpp b/modules/mono/utils/path_utils.cpp
index ec04d50704..64aec5d359 100644
--- a/modules/mono/utils/path_utils.cpp
+++ b/modules/mono/utils/path_utils.cpp
@@ -36,6 +36,7 @@
#include "core/os/os.h"
#ifdef WINDOWS_ENABLED
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#define ENV_PATH_SEP ";"
diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp
index 6ac5b55156..daf3c14f3b 100644
--- a/platform/uwp/os_uwp.cpp
+++ b/platform/uwp/os_uwp.cpp
@@ -28,14 +28,12 @@
/* 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/config/project_settings.h"
#include "core/io/marshalls.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 "drivers/windows/mutex_windows.h"
diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h
index c9b2600c8e..7945f409a1 100644
--- a/platform/uwp/os_uwp.h
+++ b/platform/uwp/os_uwp.h
@@ -45,6 +45,7 @@
#include <fcntl.h>
#include <io.h>
#include <stdio.h>
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
class OS_UWP : public OS {
diff --git a/platform/windows/context_gl_windows.h b/platform/windows/context_gl_windows.h
index c8e8a0891d..feff1d825b 100644
--- a/platform/windows/context_gl_windows.h
+++ b/platform/windows/context_gl_windows.h
@@ -38,6 +38,7 @@
#include "core/error/error_list.h"
#include "core/os/os.h"
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
typedef bool(APIENTRY *PFNWGLSWAPINTERVALEXTPROC)(int interval);
diff --git a/platform/windows/crash_handler_windows.h b/platform/windows/crash_handler_windows.h
index e1ec8e6787..5cdc6d3e05 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 <windows.h>
// Crash handler exception only enabled with MSVC
diff --git a/platform/windows/display_server_windows.h b/platform/windows/display_server_windows.h
index 8b82288a40..6a90b28579 100644
--- a/platform/windows/display_server_windows.h
+++ b/platform/windows/display_server_windows.h
@@ -63,6 +63,7 @@
#include <fcntl.h>
#include <io.h>
#include <stdio.h>
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <windowsx.h>
diff --git a/platform/windows/key_mapping_windows.h b/platform/windows/key_mapping_windows.h
index f260666a3e..d056e88f06 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 <windows.h>
-
#include <winuser.h>
class KeyMappingWindows {
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 458970c90f..c03b600f2e 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -28,15 +28,13 @@
/* 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/debugger/engine_debugger.h"
#include "core/debugger/script_debugger.h"
#include "core/io/marshalls.h"
#include "core/version_generated.gen.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 c4a2eda8f4..d24afa91eb 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -57,7 +57,9 @@
#include <fcntl.h>
#include <io.h>
+#include <shellapi.h>
#include <stdio.h>
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <windowsx.h>
diff --git a/platform/windows/vulkan_context_win.h b/platform/windows/vulkan_context_win.h
index 39dd2641fd..61e66b8ae0 100644
--- a/platform/windows/vulkan_context_win.h
+++ b/platform/windows/vulkan_context_win.h
@@ -32,6 +32,8 @@
#define VULKAN_DEVICE_WIN_H
#include "drivers/vulkan/vulkan_context.h"
+
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
class VulkanContextWindows : public VulkanContext {
diff --git a/platform/windows/windows_terminal_logger.cpp b/platform/windows/windows_terminal_logger.cpp
index 8cab7ca521..e54a61fdfd 100644
--- a/platform/windows/windows_terminal_logger.cpp
+++ b/platform/windows/windows_terminal_logger.cpp
@@ -33,6 +33,7 @@
#ifdef WINDOWS_ENABLED
#include <stdio.h>
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
void WindowsTerminalLogger::logv(const char *p_format, va_list p_list, bool p_err) {