shithub: openh264

Download patch

ref: ca36beb3fac4a4d05d36d29ab65606557b3e0137
parent: f27b22f07c6973e78cf18aee4471c49af9d62462
parent: ed62d01609d74585a76862dea115ea24200b1d27
author: Ethan Hugg <ethanhugg@gmail.com>
date: Sat Apr 12 06:14:37 EDT 2014

Merge pull request #675 from mstorsjo/silence-crt-unsafe-warnings

Silence MSVC warnings about "unsafe" standard C functions in console apps

--- a/codec/console/dec/src/h264dec.cpp
+++ b/codec/console/dec/src/h264dec.cpp
@@ -32,6 +32,7 @@
  */
 
 #if defined (_WIN32)
+#define _CRT_SECURE_NO_WARNINGS
 #include <windows.h>
 #include <tchar.h>
 #else
--- a/codec/console/dec/src/read_config.cpp
+++ b/codec/console/dec/src/read_config.cpp
@@ -38,6 +38,7 @@
  *
  *****************************************************************************/
 
+#define _CRT_SECURE_NO_WARNINGS
 #include <string.h>
 #include <stdio.h>
 
--- a/codec/console/enc/src/read_config.cpp
+++ b/codec/console/enc/src/read_config.cpp
@@ -38,15 +38,11 @@
  *
  *****************************************************************************/
 
+#define _CRT_SECURE_NO_WARNINGS
 #include <stdio.h>
 #include <string.h>
 #include "read_config.h"
 
-#if defined(_MSC_VER)
-#pragma warning(push)
-#pragma warning(disable:4996)
-#endif
-
 CReadConfig::CReadConfig()
   : m_pCfgFile (NULL)
   , m_strCfgFileName ("")
@@ -141,7 +137,3 @@
 const string& CReadConfig::GetFileName() {
   return m_strCfgFileName;
 }
-
-#if defined(_MSC_VER)
-#pragma warning(pop)
-#endif
--- a/codec/console/enc/src/welsenc.cpp
+++ b/codec/console/enc/src/welsenc.cpp
@@ -30,6 +30,7 @@
  *
  */
 
+#define _CRT_SECURE_NO_WARNINGS
 #include <stdio.h>
 #include <string.h>
 #include <assert.h>