diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 099f21b..48264c8 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -8,6 +8,9 @@ macro(define_papilio_example example_name) endmacro() define_papilio_example(info) +if(WIN32) + target_compile_definitions(info PRIVATE _CRT_SECURE_NO_WARNINGS) +endif() define_papilio_example(script_demo) diff --git a/include/papilio/core.hpp b/include/papilio/core.hpp index 7e9fdbb..218d463 100755 --- a/include/papilio/core.hpp +++ b/include/papilio/core.hpp @@ -1547,11 +1547,6 @@ namespace detail } } // namespace detail -#ifdef PAPILIO_COMPILER_CLANG -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wnon-virtual-dtor" -#endif - /** * @brief Base of format argument storage. * @@ -1682,10 +1677,6 @@ class format_args_base #endif }; -#ifdef PAPILIO_COMPILER_CLANG -# pragma clang diagnostic pop -#endif - PAPILIO_EXPORT template struct is_format_args : std::bool_constant, T>> diff --git a/include/papilio/detail/prefix.hpp b/include/papilio/detail/prefix.hpp index 72f6662..c5bbad8 100644 --- a/include/papilio/detail/prefix.hpp +++ b/include/papilio/detail/prefix.hpp @@ -14,6 +14,7 @@ # pragma clang diagnostic ignored "-Wpadded" # pragma clang diagnostic ignored "-Wcovered-switch-default" # pragma clang diagnostic ignored "-Wsuggest-destructor-override" +# pragma clang diagnostic ignored "-Wnon-virtual-dtor" # if __clang_major__ >= 16 # pragma clang diagnostic ignored "-Wunsafe-buffer-usage" diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 3ed4b92..f9586d0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -11,6 +11,9 @@ function(configure_test test_target) ) # Use a large DISCOVERY_TIMEOUT value reduce accidental CI failure gtest_discover_tests(${test_target} DISCOVERY_TIMEOUT 1000) + if(WIN32) + target_compile_definitions(${test_target} PRIVATE _CRT_SECURE_NO_WARNINGS) + endif() endfunction() macro(papilio_simple_test test_name) diff --git a/test/test_format/chrono.cpp b/test/test_format/chrono.cpp index 7bc854a..a4aa8eb 100644 --- a/test/test_format/chrono.cpp +++ b/test/test_format/chrono.cpp @@ -10,11 +10,8 @@ static std::tm create_tm_epoch() // The Unix epoch (January 1, 1970) const std::time_t t = 0; std::tm result{}; -#ifdef PAPILIO_STDLIB_MSVC_STL - gmtime_s(&result, &t); -#else + result = *std::gmtime(&t); -#endif return result; }