build: Fix C4005 "macro redefinition" MSVC warnings in examples
This commit is contained in:
@@ -2,9 +2,6 @@ add_library(example INTERFACE)
|
||||
target_include_directories(example INTERFACE
|
||||
${PROJECT_SOURCE_DIR}/include
|
||||
)
|
||||
target_compile_options(example INTERFACE
|
||||
$<$<C_COMPILER_ID:MSVC>:/wd4005>
|
||||
)
|
||||
target_link_libraries(example INTERFACE
|
||||
$<$<PLATFORM_ID:Windows>:bcrypt>
|
||||
)
|
||||
|
||||
@@ -17,7 +17,13 @@
|
||||
*/
|
||||
|
||||
#if defined(_WIN32)
|
||||
/*
|
||||
* The defined WIN32_NO_STATUS macro disables return code definitions in
|
||||
* windows.h, which avoids "macro redefinition" MSVC warnings in ntstatus.h.
|
||||
*/
|
||||
#define WIN32_NO_STATUS
|
||||
#include <windows.h>
|
||||
#undef WIN32_NO_STATUS
|
||||
#include <ntstatus.h>
|
||||
#include <bcrypt.h>
|
||||
#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
|
||||
|
||||
Reference in New Issue
Block a user