Commit f448d75a authored by Alexander Alekhin's avatar Alexander Alekhin

build: added DEBUG build guard

To prevent linkage of binary incompatible DEBUG/RELEASE binaries/runtimes
parent 520da7aa
...@@ -48,6 +48,23 @@ ...@@ -48,6 +48,23 @@
//! @addtogroup core_utils //! @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 #ifdef __OPENCV_BUILD
#include "cvconfig.h" #include "cvconfig.h"
#endif #endif
......
...@@ -62,6 +62,8 @@ namespace cv ...@@ -62,6 +62,8 @@ namespace cv
enum { ACCESS_READ=1<<24, ACCESS_WRITE=1<<25, enum { ACCESS_READ=1<<24, ACCESS_WRITE=1<<25,
ACCESS_RW=3<<24, ACCESS_MASK=ACCESS_RW, ACCESS_FAST=1<<26 }; ACCESS_RW=3<<24, ACCESS_MASK=ACCESS_RW, ACCESS_FAST=1<<26 };
CV__DEBUG_NS_BEGIN
class CV_EXPORTS _OutputArray; class CV_EXPORTS _OutputArray;
//////////////////////// Input/Output Array Arguments ///////////////////////////////// //////////////////////// Input/Output Array Arguments /////////////////////////////////
...@@ -400,6 +402,8 @@ public: ...@@ -400,6 +402,8 @@ public:
}; };
CV__DEBUG_NS_END
typedef const _InputArray& InputArray; typedef const _InputArray& InputArray;
typedef InputArray InputArrayOfArrays; typedef InputArray InputArrayOfArrays;
typedef const _OutputArray& OutputArray; typedef const _OutputArray& OutputArray;
......
...@@ -56,6 +56,8 @@ ...@@ -56,6 +56,8 @@
namespace cv namespace cv
{ {
CV__DEBUG_NS_BEGIN
//! @cond IGNORED //! @cond IGNORED
...@@ -392,6 +394,8 @@ inline _InputOutputArray::_InputOutputArray(const ogl::Buffer& buf) ...@@ -392,6 +394,8 @@ inline _InputOutputArray::_InputOutputArray(const ogl::Buffer& buf)
inline _InputOutputArray::_InputOutputArray(const cuda::HostMem& cuda_mem) inline _InputOutputArray::_InputOutputArray(const cuda::HostMem& cuda_mem)
{ init(FIXED_TYPE + FIXED_SIZE + CUDA_HOST_MEM + ACCESS_RW, &cuda_mem); } { init(FIXED_TYPE + FIXED_SIZE + CUDA_HOST_MEM + ACCESS_RW, &cuda_mem); }
CV__DEBUG_NS_END
//////////////////////////////////////////// Mat ////////////////////////////////////////// //////////////////////////////////////////// Mat //////////////////////////////////////////
inline inline
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment