Browse Source

Add missing WIN32_LEAN_AND_MEAN

Bartłomiej T. Listwon 3 years ago
parent
commit
f463e612a1

+ 2 - 2
drivers/unix/ip_unix.cpp

@@ -36,9 +36,9 @@
 
 
 #ifdef WINDOWS_ENABLED
 #ifdef WINDOWS_ENABLED
 #include <stdio.h>
 #include <stdio.h>
-#include <winsock2.h>
-// Needs to be included after winsocks2.h
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <windows.h>
+#include <winsock2.h>
 #include <ws2tcpip.h>
 #include <ws2tcpip.h>
 #ifndef UWP_ENABLED
 #ifndef UWP_ENABLED
 #include <iphlpapi.h>
 #include <iphlpapi.h>

+ 1 - 0
drivers/wasapi/audio_driver_wasapi.h

@@ -39,6 +39,7 @@
 
 
 #include <audioclient.h>
 #include <audioclient.h>
 #include <mmdeviceapi.h>
 #include <mmdeviceapi.h>
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <windows.h>
 
 
 class AudioDriverWASAPI : public AudioDriver {
 class AudioDriverWASAPI : public AudioDriver {

+ 1 - 0
drivers/windows/dir_access_windows.cpp

@@ -37,6 +37,7 @@
 
 
 #include <stdio.h>
 #include <stdio.h>
 #include <wchar.h>
 #include <wchar.h>
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <windows.h>
 
 
 /*
 /*

+ 1 - 0
drivers/windows/file_access_windows.cpp

@@ -37,6 +37,7 @@
 
 
 #include <share.h> // _SH_DENYNO
 #include <share.h> // _SH_DENYNO
 #include <shlwapi.h>
 #include <shlwapi.h>
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <windows.h>
 
 
 #include <errno.h>
 #include <errno.h>

+ 1 - 0
drivers/winmidi/midi_driver_winmidi.h

@@ -37,6 +37,7 @@
 #include "core/vector.h"
 #include "core/vector.h"
 
 
 #include <stdio.h>
 #include <stdio.h>
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <windows.h>
 
 
 #include <mmsystem.h>
 #include <mmsystem.h>

+ 1 - 0
drivers/xaudio2/audio_driver_xaudio2.h

@@ -36,6 +36,7 @@
 #include "servers/audio_server.h"
 #include "servers/audio_server.h"
 
 
 #include <mmsystem.h>
 #include <mmsystem.h>
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <windows.h>
 #include <wrl/client.h>
 #include <wrl/client.h>
 #include <xaudio2.h>
 #include <xaudio2.h>

+ 1 - 1
modules/mono/utils/mono_reg_utils.cpp

@@ -35,7 +35,7 @@
 
 
 #include "core/os/os.h"
 #include "core/os/os.h"
 
 
-// Here, after os/os.h
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <windows.h>
 
 
 namespace MonoRegUtils {
 namespace MonoRegUtils {

+ 1 - 0
modules/mono/utils/path_utils.cpp

@@ -36,6 +36,7 @@
 #include "core/project_settings.h"
 #include "core/project_settings.h"
 
 
 #ifdef WINDOWS_ENABLED
 #ifdef WINDOWS_ENABLED
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <windows.h>
 
 
 #define ENV_PATH_SEP ";"
 #define ENV_PATH_SEP ";"

+ 1 - 0
modules/mono/utils/thread_local.cpp

@@ -31,6 +31,7 @@
 #include "thread_local.h"
 #include "thread_local.h"
 
 
 #ifdef WINDOWS_ENABLED
 #ifdef WINDOWS_ENABLED
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <windows.h>
 #else
 #else
 #include <pthread.h>
 #include <pthread.h>

+ 1 - 3
platform/uwp/os_uwp.cpp

@@ -28,9 +28,6 @@
 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
 /* 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 "os_uwp.h"
 
 
 #include "core/io/marshalls.h"
 #include "core/io/marshalls.h"
@@ -38,6 +35,7 @@
 #include "drivers/gles2/rasterizer_gles2.h"
 #include "drivers/gles2/rasterizer_gles2.h"
 #include "drivers/gles3/rasterizer_gles3.h"
 #include "drivers/gles3/rasterizer_gles3.h"
 #include "drivers/unix/ip_unix.h"
 #include "drivers/unix/ip_unix.h"
+#include "drivers/unix/net_socket_posix.h"
 #include "drivers/windows/dir_access_windows.h"
 #include "drivers/windows/dir_access_windows.h"
 #include "drivers/windows/file_access_windows.h"
 #include "drivers/windows/file_access_windows.h"
 #include "main/main.h"
 #include "main/main.h"

+ 1 - 0
platform/uwp/os_uwp.h

@@ -47,6 +47,7 @@
 #include <fcntl.h>
 #include <fcntl.h>
 #include <io.h>
 #include <io.h>
 #include <stdio.h>
 #include <stdio.h>
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <windows.h>
 
 
 class OS_UWP : public OS {
 class OS_UWP : public OS {

+ 1 - 0
platform/windows/context_gl_windows.h

@@ -38,6 +38,7 @@
 #include "core/error_list.h"
 #include "core/error_list.h"
 #include "core/os/os.h"
 #include "core/os/os.h"
 
 
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <windows.h>
 
 
 typedef bool(APIENTRY *PFNWGLSWAPINTERVALEXTPROC)(int interval);
 typedef bool(APIENTRY *PFNWGLSWAPINTERVALEXTPROC)(int interval);

+ 1 - 0
platform/windows/crash_handler_windows.h

@@ -31,6 +31,7 @@
 #ifndef CRASH_HANDLER_WINDOWS_H
 #ifndef CRASH_HANDLER_WINDOWS_H
 #define CRASH_HANDLER_WINDOWS_H
 #define CRASH_HANDLER_WINDOWS_H
 
 
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <windows.h>
 
 
 // Crash handler exception only enabled with MSVC
 // Crash handler exception only enabled with MSVC

+ 1 - 1
platform/windows/key_mapping_windows.h

@@ -33,8 +33,8 @@
 
 
 #include "core/os/keyboard.h"
 #include "core/os/keyboard.h"
 
 
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <windows.h>
-
 #include <winuser.h>
 #include <winuser.h>
 
 
 class KeyMappingWindows {
 class KeyMappingWindows {

+ 1 - 3
platform/windows/os_windows.cpp

@@ -28,9 +28,6 @@
 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
 /* 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 "os_windows.h"
 
 
 #include "core/io/marshalls.h"
 #include "core/io/marshalls.h"
@@ -38,6 +35,7 @@
 #include "core/version_generated.gen.h"
 #include "core/version_generated.gen.h"
 #include "drivers/gles2/rasterizer_gles2.h"
 #include "drivers/gles2/rasterizer_gles2.h"
 #include "drivers/gles3/rasterizer_gles3.h"
 #include "drivers/gles3/rasterizer_gles3.h"
+#include "drivers/unix/net_socket_posix.h"
 #include "drivers/windows/dir_access_windows.h"
 #include "drivers/windows/dir_access_windows.h"
 #include "drivers/windows/file_access_windows.h"
 #include "drivers/windows/file_access_windows.h"
 #include "joypad_windows.h"
 #include "joypad_windows.h"

+ 2 - 0
platform/windows/os_windows.h

@@ -52,7 +52,9 @@
 #include <dwmapi.h>
 #include <dwmapi.h>
 #include <fcntl.h>
 #include <fcntl.h>
 #include <io.h>
 #include <io.h>
+#include <shellapi.h>
 #include <stdio.h>
 #include <stdio.h>
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <windows.h>
 #include <windowsx.h>
 #include <windowsx.h>
 // WinTab API
 // WinTab API

+ 1 - 0
platform/windows/power_windows.h

@@ -35,6 +35,7 @@
 #include "core/os/file_access.h"
 #include "core/os/file_access.h"
 #include "core/os/os.h"
 #include "core/os/os.h"
 
 
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <windows.h>
 
 
 class PowerWindows {
 class PowerWindows {

+ 1 - 0
platform/windows/windows_terminal_logger.cpp

@@ -33,6 +33,7 @@
 #ifdef WINDOWS_ENABLED
 #ifdef WINDOWS_ENABLED
 
 
 #include <stdio.h>
 #include <stdio.h>
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <windows.h>
 
 
 void WindowsTerminalLogger::logv(const char *p_format, va_list p_list, bool p_err) {
 void WindowsTerminalLogger::logv(const char *p_format, va_list p_list, bool p_err) {