shithub: openh264

Download patch

ref: ef82e18d741370e7eedb1a1d4f615844e65e1863
parent: 1646f86b3795945aee81259d860db41052d7b00d
author: Martin Storsjö <[email protected]>
date: Fri Jan 16 05:34:27 EST 2015

Silence warnings about insecure CRT functions in the test suite

There is no problem in using the "insecure" CRT functions, as long as
they are used correctly - especially not within the test suite where
they are only are exposed to the test suite input data.

Within the library, these are used via the library internal wrappers
in codec/common/src/crt_util_safe_x.cpp, but we'd rather not use them
in the test suite - just use the normal standard C functions here.

--- a/build/msvc-common.mk
+++ b/build/msvc-common.mk
@@ -42,3 +42,4 @@
 EXTRA_LIBRARY=$(PROJECT_NAME)_dll.lib
 SHLDFLAGS=-Fd$(PROJECT_NAME).pdb -link -def:openh264.def -implib:$(EXTRA_LIBRARY)
 STATIC_LDFLAGS=
+CODEC_UNITTEST_CFLAGS=-D_CRT_SECURE_NO_WARNINGS
--- a/test/build/win32/codec_ut/codec_unittest.vcproj
+++ b/test/build/win32/codec_ut/codec_unittest.vcproj
@@ -45,7 +45,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories="..\..\..\;..\..\..\..\codec\encoder\plus\inc;..\..\..\..\codec\encoder\core\inc;..\..\..\..\codec\common\inc;..\..\..\..\codec\api\svc;..\..\..\..\gtest\include;..\..\..\codec\processing\src\common;..\..\..\..\codec\processing\interface"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;X86_ASM"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;X86_ASM;_CRT_SECURE_NO_WARNINGS"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="1"
@@ -119,7 +119,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories="..\..\..\;..\..\..\..\codec\encoder\plus\inc;..\..\..\..\codec\encoder\core\inc;..\..\..\..\codec\common\inc;..\..\..\..\codec\api\svc;..\..\..\..\gtest\include;..\..\..\codec\processing\src\common;..\..\..\..\codec\processing\interface"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="1"
@@ -194,7 +194,7 @@
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
 				AdditionalIncludeDirectories="..\..\..\;..\..\..\..\codec\encoder\plus\inc;..\..\..\..\codec\encoder\core\inc;..\..\..\..\codec\common\inc;..\..\..\..\codec\api\svc;..\..\..\..\gtest\include;..\..\..\codec\processing\src\common;..\..\..\..\codec\processing\interface"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;X86_ASM"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;X86_ASM;_CRT_SECURE_NO_WARNINGS"
 				RuntimeLibrary="0"
 				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
@@ -270,7 +270,7 @@
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
 				AdditionalIncludeDirectories="..\..\..\;..\..\..\..\codec\encoder\plus\inc;..\..\..\..\codec\encoder\core\inc;..\..\..\..\codec\common\inc;..\..\..\..\codec\api\svc;..\..\..\..\gtest\include;..\..\..\codec\processing\src\common;..\..\..\..\codec\processing\interface"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
 				RuntimeLibrary="0"
 				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"