From 76b5e19eb3a1e343f6ca5d9c0ab25d643665b760 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Wed, 11 Dec 2019 00:35:13 +0000 Subject: [PATCH] core: add "namespace cv" in CV_StaticAssert fallback implementation --- modules/core/include/opencv2/core/cvdef.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h index ea446b3..c0c6867 100644 --- a/modules/core/include/opencv2/core/cvdef.h +++ b/modules/core/include/opencv2/core/cvdef.h @@ -118,9 +118,11 @@ namespace cv { namespace debug_build_guard { } using namespace debug_build_guard # if !defined(__clang__) && defined(__GNUC__) && (__GNUC__*100 + __GNUC_MINOR__ > 302) # define CV_StaticAssert(condition, reason) ({ extern int __attribute__((error("CV_StaticAssert: " reason " " #condition))) CV_StaticAssert(); ((condition) ? 0 : CV_StaticAssert()); }) # else +namespace cv { template struct CV_StaticAssert_failed; template <> struct CV_StaticAssert_failed { enum { val = 1 }; }; template struct CV_StaticAssert_test {}; +} # define CV_StaticAssert(condition, reason)\ typedef cv::CV_StaticAssert_test< sizeof(cv::CV_StaticAssert_failed< static_cast(condition) >) > CVAUX_CONCAT(CV_StaticAssert_failed_at_, __LINE__) # endif -- 2.7.4