From 95a438d233836539a0569a877c4afa1c0d26c3ed Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Fri, 14 Jul 2017 13:02:25 +0300 Subject: [PATCH 1/2] OpenCV version '-cvsdk' --- modules/core/include/opencv2/core/version.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/include/opencv2/core/version.hpp b/modules/core/include/opencv2/core/version.hpp index c48a40356f..31606d7e68 100644 --- a/modules/core/include/opencv2/core/version.hpp +++ b/modules/core/include/opencv2/core/version.hpp @@ -53,7 +53,7 @@ #define CV_VERSION_MAJOR 3 #define CV_VERSION_MINOR 3 #define CV_VERSION_REVISION 0 -#define CV_VERSION_STATUS "-rc" +#define CV_VERSION_STATUS "-cvsdk" #define CVAUX_STR_EXP(__A) #__A #define CVAUX_STR(__A) CVAUX_STR_EXP(__A) From e8357c0544c82beda237defc0abc90ee28992ee7 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Fri, 14 Jul 2017 00:56:09 +0300 Subject: [PATCH 2/2] build: added DEBUG build guard To prevent linkage of binary incompatible DEBUG/RELEASE binaries/runtimes --- modules/core/include/opencv2/core/cvdef.h | 17 +++++++++++++++++ modules/core/include/opencv2/core/mat.hpp | 4 ++++ modules/core/include/opencv2/core/mat.inl.hpp | 4 ++++ 3 files changed, 25 insertions(+) diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h index b128d257ba..cde1b72610 100644 --- a/modules/core/include/opencv2/core/cvdef.h +++ b/modules/core/include/opencv2/core/cvdef.h @@ -48,6 +48,23 @@ //! @addtogroup core_utils //! @{ +#if !defined CV_DOXYGEN && !defined CV_IGNORE_DEBUG_BUILD_GUARD +#if (defined(_MSC_VER) && (defined(DEBUG) || defined(_DEBUG))) || \ + (defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_DEBUG_PEDANTIC)) +// Guard to prevent using of binary incompatible binaries / runtimes +// https://github.com/opencv/opencv/pull/9161 +#define CV__DEBUG_NS_BEGIN namespace debug_build_guard { +#define CV__DEBUG_NS_END } +namespace cv { namespace debug_build_guard { } using namespace debug_build_guard; } +#endif +#endif + +#ifndef CV__DEBUG_NS_BEGIN +#define CV__DEBUG_NS_BEGIN +#define CV__DEBUG_NS_END +#endif + + #ifdef __OPENCV_BUILD #include "cvconfig.h" #endif diff --git a/modules/core/include/opencv2/core/mat.hpp b/modules/core/include/opencv2/core/mat.hpp index 37ed5568d7..17221e16d8 100644 --- a/modules/core/include/opencv2/core/mat.hpp +++ b/modules/core/include/opencv2/core/mat.hpp @@ -62,6 +62,8 @@ namespace cv enum { ACCESS_READ=1<<24, ACCESS_WRITE=1<<25, ACCESS_RW=3<<24, ACCESS_MASK=ACCESS_RW, ACCESS_FAST=1<<26 }; +CV__DEBUG_NS_BEGIN + class CV_EXPORTS _OutputArray; //////////////////////// Input/Output Array Arguments ///////////////////////////////// @@ -400,6 +402,8 @@ public: }; +CV__DEBUG_NS_END + typedef const _InputArray& InputArray; typedef InputArray InputArrayOfArrays; typedef const _OutputArray& OutputArray; diff --git a/modules/core/include/opencv2/core/mat.inl.hpp b/modules/core/include/opencv2/core/mat.inl.hpp index 3006a1fed7..025780e6e5 100644 --- a/modules/core/include/opencv2/core/mat.inl.hpp +++ b/modules/core/include/opencv2/core/mat.inl.hpp @@ -56,6 +56,8 @@ namespace cv { +CV__DEBUG_NS_BEGIN + //! @cond IGNORED @@ -392,6 +394,8 @@ inline _InputOutputArray::_InputOutputArray(const ogl::Buffer& buf) inline _InputOutputArray::_InputOutputArray(const cuda::HostMem& cuda_mem) { init(FIXED_TYPE + FIXED_SIZE + CUDA_HOST_MEM + ACCESS_RW, &cuda_mem); } +CV__DEBUG_NS_END + //////////////////////////////////////////// Mat ////////////////////////////////////////// inline