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

Set global definition WIN32_LEAN_AND_MEAN (#2807)

Set definition WIN32_LEAN_AND_MEAN to avoid windows.h including a lot of libs that are usually not used.
B3n30 9 лет назад
Родитель
Сommit
6ba089fafb
2 измененных файлов с 5 добавлено и 0 удалено
  1. 2 0
      CMakeLists.txt
  2. 3 0
      src/citra/citra.cpp

+ 2 - 0
CMakeLists.txt

@@ -79,6 +79,8 @@ else()
     add_definitions(/D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /D_SCL_SECURE_NO_WARNINGS)
     add_definitions(/D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /D_SCL_SECURE_NO_WARNINGS)
     # Avoid windows.h junk
     # Avoid windows.h junk
     add_definitions(/DNOMINMAX)
     add_definitions(/DNOMINMAX)
+    # Avoid windows.h from including some usually unused libs like winsocks.h, since this might cause some redefinition errors.
+    add_definitions(/DWIN32_LEAN_AND_MEAN)
 
 
     # set up output paths for executable binaries (.exe-files, and .dll-files on DLL-capable platforms)
     # set up output paths for executable binaries (.exe-files, and .dll-files on DLL-capable platforms)
     set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
     set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

+ 3 - 0
src/citra/citra.cpp

@@ -18,7 +18,10 @@
 #endif
 #endif
 
 
 #ifdef _WIN32
 #ifdef _WIN32
+// windows.h needs to be included before shellapi.h
 #include <windows.h>
 #include <windows.h>
+
+#include <shellapi.h>
 #endif
 #endif
 
 
 #include "citra/config.h"
 #include "citra/config.h"