[x265] Disable exceptions and buffer security check for MSVC

Joshua Bowman JBowman at sunmaid.com
Tue Jun 3 00:30:41 CEST 2014


My apologies, in MSVC this needs to have warning 4530 disabled as well, due to xlocale requiring C++ exceptions. 

diff -r 5b6c9cda191b source/common/common.h
--- a/source/common/common.h	Mon Jun 02 14:21:04 2014 -0500
+++ b/source/common/common.h	Mon Jun 02 15:29:33 2014 -0700
@@ -24,6 +24,10 @@
 #ifndef X265_COMMON_H
 #define X265_COMMON_H
 
+#if _MSC_VER
+#pragma warning(disable: 4530) // xlocale requires C++ exceptions, but isn't used.
+#endif
+
 #include <algorithm>
 #include <climits>
 #include <cmath> 
diff -r 5b6c9cda191b source/Lib/TLibCommon/CommonDef.h
--- a/source/Lib/TLibCommon/CommonDef.h	Mon Jun 02 14:21:04 2014 -0500
+++ b/source/Lib/TLibCommon/CommonDef.h	Mon Jun 02 15:29:43 2014 -0700
@@ -38,6 +38,10 @@
 #ifndef X265_COMMONDEF_H
 #define X265_COMMONDEF_H
 
+#if _MSC_VER
+#pragma warning(disable: 4530) // xlocale requires C++ exceptions, but isn't used.
+#endif
+
 #include <cstdlib>
 #include "common.h"
 #include "TypeDef.h"


-----Original Message-----
From: x265-devel [mailto:x265-devel-bounces at videolan.org] On Behalf Of Joshua Bowman
Sent: Monday, June 2, 2014 2:29 PM
To: x265-devel at videolan.org
Subject: [x265] Disable exceptions and buffer security check for MSVC

Disable exceptions (/EHsc) and buffer security check (/GS) for MSVC.

diff -r 5b6c9cda191b source/CMakeLists.txt
--- a/source/CMakeLists.txt	Mon Jun 02 14:21:04 2014 -0500
+++ b/source/CMakeLists.txt	Mon Jun 02 14:20:12 2014 -0700
@@ -93,6 +93,8 @@
     add_definitions(/W4)  # Full warnings
     add_definitions(/Ob2) # always inline
     add_definitions(/MP)  # multithreaded build
+    add_definitions(/GS-) # no buffer security check
+    string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
 
     # disable Microsofts suggestions for proprietary secure APIs
     add_definitions(/D_CRT_SECURE_NO_WARNINGS)
_______________________________________________
x265-devel mailing list
x265-devel at videolan.org
https://mailman.videolan.org/listinfo/x265-devel


More information about the x265-devel mailing list