From 25355c6e9d6b0e375e5d0679e109833a0bc00fed Mon Sep 17 00:00:00 2001 From: denchat <19730041+denchat@users.noreply.github.com> Date: Tue, 7 May 2019 21:14:47 +0700 Subject: [PATCH] This translation unit includes `gtest.h` in which using something like `strncpy` Suppress MSVC warnings from `gtest.h` included. Warning sample: fmt-master\test\gtest\gtest.h(2873,10): warning: 'strncpy' is deprecated: This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations] --- test/custom-formatter-test.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/custom-formatter-test.cc b/test/custom-formatter-test.cc index d33b12f5..968cce2b 100644 --- a/test/custom-formatter-test.cc +++ b/test/custom-formatter-test.cc @@ -5,6 +5,12 @@ // // For the license information refer to format.h. +#ifdef _MSC_VER +# ifndef _CRT_SECURE_NO_WARNINGS +# define _CRT_SECURE_NO_WARNINGS +# endif +#endif + #include "fmt/format.h" #include "gtest-extra.h"