diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h index 3f55cc1d8c..91ebd20774 100644 --- a/modules/core/include/opencv2/core/cvdef.h +++ b/modules/core/include/opencv2/core/cvdef.h @@ -438,7 +438,7 @@ Cv64suf; #ifdef CV_XADD // allow to use user-defined macro -#elif defined __GNUC__ +#elif defined __GNUC__ || defined __clang__ # if defined __clang__ && __clang_major__ >= 3 && !defined __ANDROID__ && !defined __EMSCRIPTEN__ && !defined(__CUDACC__) # ifdef __ATOMIC_ACQ_REL # define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), delta, __ATOMIC_ACQ_REL) diff --git a/modules/core/include/opencv2/core/fast_math.hpp b/modules/core/include/opencv2/core/fast_math.hpp index c76936afe4..92c2f350a8 100644 --- a/modules/core/include/opencv2/core/fast_math.hpp +++ b/modules/core/include/opencv2/core/fast_math.hpp @@ -54,12 +54,14 @@ * fast math * \****************************************************************************************/ -#if defined __BORLANDC__ -# include -#elif defined __cplusplus +#ifdef __cplusplus # include #else -# include +# ifdef __BORLANDC__ +# include +# else +# include +# endif #endif #ifdef HAVE_TEGRA_OPTIMIZATION