[platform] msvc.cmake: Add -D_SCL_SECURE_NO_WARNINGS.

[fmt] chrono.h: Revert the MSVC C4996 warning pragma. It didn't work.
Adding `-D_SCL_SECURE_NO_WARNINGS` *should* fix it.
This commit is contained in:
David Korth 2025-04-01 00:28:17 -04:00
parent fc26afa3f6
commit 54e8215488
2 changed files with 1 additions and 8 deletions

View File

@ -21,7 +21,7 @@ ENDIF(NOT CMAKE_SYSTEM_VERSION)
# - C4477: 'function' : format string 'string' requires an argument of type 'type', but variadic argument number has type 'type'
SET(RP_C_FLAGS_COMMON "/nologo /W3 /WX /wd4355 /we4013 /we4024 /we4047 /we4477")
SET(RP_CXX_FLAGS_COMMON "${RP_C_FLAGS_COMMON} -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING")
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
# NOTE: /TSAWARE is automatically set for Windows 2000 and later. (as of at least Visual Studio .NET 2003)
# NOTE 2: /TSAWARE is not applicable for DLLs.
SET(RP_EXE_LINKER_FLAGS_COMMON "/NOLOGO /DYNAMICBASE /NXCOMPAT /LARGEADDRESSAWARE")

View File

@ -656,14 +656,7 @@ inline void write_digit2_separated(char* buf, unsigned a, unsigned b,
if (const_check(is_big_endian())) {
char tmp[len];
std::memcpy(tmp, &digits, len);
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4996)
#endif /* _MSC_VER */
std::reverse_copy(tmp, tmp + len, buf);
#ifdef _MSC_VER
# pragma warning(pop)
#endif /* _MSC_VER */
} else {
std::memcpy(buf, &digits, len);
}