From 3c4e04597c21349c5ac7263e4eb9644f54cbfcb4 Mon Sep 17 00:00:00 2001 From: jackarain Date: Mon, 25 Dec 2023 15:08:04 +0800 Subject: [PATCH] Fix warning '_CRT_SECURE_NO_WARNINGS': macro redefinition --- src/cstdio.cpp | 2 ++ src/cstdlib.cpp | 2 ++ test/test_system.cpp | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/cstdio.cpp b/src/cstdio.cpp index 0aa46ed7..2ff9574c 100644 --- a/src/cstdio.cpp +++ b/src/cstdio.cpp @@ -8,7 +8,9 @@ #define BOOST_NOWIDE_SOURCE #ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#endif #elif defined(__MINGW32__) && defined(__STRICT_ANSI__) // Need the _w* functions which are extensions on MinGW but not on MinGW-w64 #include <_mingw.h> diff --git a/src/cstdlib.cpp b/src/cstdlib.cpp index 4234a715..ab0d4455 100644 --- a/src/cstdlib.cpp +++ b/src/cstdlib.cpp @@ -8,7 +8,9 @@ #define BOOST_NOWIDE_SOURCE #ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#endif #elif defined(__MINGW32__) && defined(__STRICT_ANSI__) // Need the _w* functions which are extensions on MinGW but not on MinGW-w64 #include <_mingw.h> diff --git a/test/test_system.cpp b/test/test_system.cpp index 2c0e37e7..76171375 100644 --- a/test/test_system.cpp +++ b/test/test_system.cpp @@ -5,8 +5,10 @@ // https://www.boost.org/LICENSE_1_0.txt #ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS #endif +#endif #include #include