Просмотр исходного кода

*: define WIN32_LEAN_AND_MEAN before #include <windows.h>

Daniele Bartolini 4 лет назад
Родитель
Сommit
2d85ffdb84

+ 3 - 0
src/core/error/callstack_windows.cpp

@@ -8,6 +8,9 @@
 #if CROWN_PLATFORM_WINDOWS
 
 #include "core/strings/string_stream.inl"
+#ifndef WIN32_LEAN_AND_MEAN
+	#define WIN32_LEAN_AND_MEAN
+#endif
 #include <windows.h>
 #pragma warning(push)
 #pragma warning(disable:4091) // 'keyword' : ignored on left of 'type' when no variable is declared

+ 3 - 0
src/core/filesystem/file_monitor_windows.cpp

@@ -14,6 +14,9 @@
 #include "core/os.h"
 #include "core/strings/dynamic_string.inl"
 #include "core/thread/thread.h"
+#ifndef WIN32_LEAN_AND_MEAN
+	#define WIN32_LEAN_AND_MEAN
+#endif
 #include <windows.h>
 
 namespace crown

+ 3 - 0
src/core/filesystem/filesystem_disk.cpp

@@ -16,6 +16,9 @@
 	#include <errno.h>
 #elif CROWN_PLATFORM_WINDOWS
 	#include <tchar.h>
+	#ifndef WIN32_LEAN_AND_MEAN
+		#define WIN32_LEAN_AND_MEAN
+	#endif
 	#include <windows.h>
 #endif
 

+ 3 - 0
src/core/os.cpp

@@ -26,6 +26,9 @@
 #elif CROWN_PLATFORM_WINDOWS
 	#include <io.h>       // _access
 	#include <stdio.h>
+	#ifndef WIN32_LEAN_AND_MEAN
+		#define WIN32_LEAN_AND_MEAN
+	#endif
 	#include <windows.h>
 #endif
 #if CROWN_PLATFORM_ANDROID

+ 3 - 0
src/core/process.cpp

@@ -12,6 +12,9 @@
 	#include <sys/wait.h> // waitpid
 	#include <errno.h>
 #elif CROWN_PLATFORM_WINDOWS
+	#ifndef WIN32_LEAN_AND_MEAN
+		#define WIN32_LEAN_AND_MEAN
+	#endif
 	#include <windows.h>
 #endif
 

+ 3 - 0
src/core/thread/condition_variable.cpp

@@ -12,6 +12,9 @@
 #if CROWN_PLATFORM_POSIX
 	#include <pthread.h>
 #elif CROWN_PLATFORM_WINDOWS
+	#ifndef WIN32_LEAN_AND_MEAN
+		#define WIN32_LEAN_AND_MEAN
+	#endif
 	#include <windows.h>
 #endif
 

+ 3 - 0
src/core/thread/mutex.cpp

@@ -11,6 +11,9 @@
 #if CROWN_PLATFORM_POSIX
 	#include <pthread.h>
 #elif CROWN_PLATFORM_WINDOWS
+	#ifndef WIN32_LEAN_AND_MEAN
+		#define WIN32_LEAN_AND_MEAN
+	#endif
 	#include <windows.h>
 #endif
 

+ 3 - 0
src/core/thread/semaphore.cpp

@@ -11,6 +11,9 @@
 #if CROWN_PLATFORM_POSIX
 	#include <pthread.h>
 #elif CROWN_PLATFORM_WINDOWS
+	#ifndef WIN32_LEAN_AND_MEAN
+		#define WIN32_LEAN_AND_MEAN
+	#endif
 	#include <windows.h>
 	#include <limits.h> // LONG_MAX
 #endif

+ 3 - 0
src/core/thread/thread.cpp

@@ -12,6 +12,9 @@
 #if CROWN_PLATFORM_POSIX
 	#include <pthread.h>
 #elif CROWN_PLATFORM_WINDOWS
+	#ifndef WIN32_LEAN_AND_MEAN
+		#define WIN32_LEAN_AND_MEAN
+	#endif
 	#include <windows.h>
 	#include <process.h>
 #endif

+ 3 - 0
src/core/time.cpp

@@ -8,6 +8,9 @@
 #if CROWN_PLATFORM_POSIX
 	#include <time.h> // clock_gettime
 #elif CROWN_PLATFORM_WINDOWS
+	#ifndef WIN32_LEAN_AND_MEAN
+		#define WIN32_LEAN_AND_MEAN
+	#endif
 	#include <windows.h>
 #endif
 

+ 5 - 2
src/resource/data_compiler.cpp

@@ -48,9 +48,12 @@
 #include <algorithm>
 #include <inttypes.h>
 #if CROWN_PLATFORM_POSIX
-#include <signal.h>
+	#include <signal.h>
 #elif CROWN_PLATFORM_WINDOWS
-#include <windows.h>
+	#ifndef WIN32_LEAN_AND_MEAN
+		#define WIN32_LEAN_AND_MEAN
+	#endif
+	#include <windows.h>
 #endif // CROWN_PLATFORM_LINUX
 
 LOG_SYSTEM(DATA_COMPILER, "data_compiler")