Skip to content
This repository was archived by the owner on Aug 1, 2022. It is now read-only.

Commit 8ce5618

Browse files
authored
Merge pull request #25 from compnerd/windows-warnings
windows: silence some "deprecation" warnings
2 parents da8dadd + f5eddec commit 8ce5618

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

Diff for: CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ set_target_properties(pthread_workqueue PROPERTIES DEBUG_POSTFIX "d")
118118
if(WIN32)
119119
target_compile_definitions(pthread_workqueue PRIVATE
120120
LIBPTHREAD_WORKQUEUE_EXPORTS;_USRDLL;_WINDLL)
121+
target_compile_definitions(pthread_workqueue
122+
PRIVATE
123+
_CRT_SECURE_NO_WARNINGS
124+
_CRT_SECURE_NO_WARNINGS_GLOBALS)
121125
else()
122126
target_compile_definitions(pthread_workqueue PRIVATE
123127
_XOPEN_SOURCE=600;_GNU_SOURCE)

Diff for: src/windows/platform.h

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#define _PTWQ_WINDOWS_PLATFORM_H 1
33

44
#define PROVIDE_LEGACY_XP_SUPPORT 1
5-
#define _CRT_SECURE_NO_WARNINGS
65
#pragma warning(disable : 4996)
76

87
#ifdef PROVIDE_LEGACY_XP_SUPPORT

Diff for: testing/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ function(ADD_UNIT_TEST TEST)
2929
PRIVATE
3030
${CMAKE_SOURCE_DIR}
3131
${CMAKE_SOURCE_DIR}/include)
32+
if(WIN32)
33+
target_compile_definitions(test_${TEST}_pthread_workqueue
34+
PRIVATE
35+
_CRT_SECURE_NO_WARNINGS)
36+
endif()
3237
target_link_libraries(test_${TEST}_pthread_workqueue
3338
PRIVATE
3439
pthread_workqueue)

0 commit comments

Comments
 (0)