From ea882d58c65eb5f8198bffbdf253822129fce0dc Mon Sep 17 00:00:00 2001 From: Vitaly Tuzov Date: Fri, 11 Jan 2019 22:40:35 +0300 Subject: [PATCH] Added CV_ALWAYS_INLINE macro --- modules/core/include/opencv2/core/cvdef.h | 10 ++++++++++ modules/imgproc/src/fixedpoint.inl.hpp | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h index afc603ab33..deb08fa003 100644 --- a/modules/core/include/opencv2/core/cvdef.h +++ b/modules/core/include/opencv2/core/cvdef.h @@ -200,6 +200,16 @@ namespace cv { namespace debug_build_guard { } using namespace debug_build_guard # endif #endif +#ifndef CV_ALWAYS_INLINE +#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) +#define CV_ALWAYS_INLINE inline __attribute__((always_inline)) +#elif defined(_MSC_VER) +#define CV_ALWAYS_INLINE __forceinline +#else +#define CV_ALWAYS_INLINE inline +#endif +#endif + #if defined CV_DISABLE_OPTIMIZATION || (defined CV_ICC && !defined CV_ENABLE_UNROLLED) # define CV_ENABLE_UNROLLED 0 #else diff --git a/modules/imgproc/src/fixedpoint.inl.hpp b/modules/imgproc/src/fixedpoint.inl.hpp index 0878dc456f..a1a75a29e1 100644 --- a/modules/imgproc/src/fixedpoint.inl.hpp +++ b/modules/imgproc/src/fixedpoint.inl.hpp @@ -11,16 +11,6 @@ #include "opencv2/core/softfloat.hpp" -#ifndef CV_ALWAYS_INLINE - #if defined(__GNUC__) && (__GNUC__ > 3 ||(__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) - #define CV_ALWAYS_INLINE inline __attribute__((always_inline)) - #elif defined(_MSC_VER) - #define CV_ALWAYS_INLINE __forceinline - #else - #define CV_ALWAYS_INLINE inline - #endif -#endif - namespace {