From 9a08b7be450c00f8bbc143d24a19f9aeb39c6efe Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Fri, 2 Nov 2012 15:29:16 +0400 Subject: [PATCH] fixed compile problem with the old Xcode (<4.5) --- modules/core/include/opencv2/core/operations.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/core/include/opencv2/core/operations.hpp b/modules/core/include/opencv2/core/operations.hpp index 74263022ee..4b6e606165 100644 --- a/modules/core/include/opencv2/core/operations.hpp +++ b/modules/core/include/opencv2/core/operations.hpp @@ -56,9 +56,12 @@ #define CV_XADD(addr,delta) _InterlockedExchangeAdd(const_cast(reinterpret_cast(addr)), delta) #elif defined __GNUC__ - #if defined __clang__ && __clang_major__ >= 3 && defined __ATOMIC_SEQ_CST - #define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), (delta), __ATOMIC_SEQ_CST) - + #if defined __clang__ && __clang_major__ >= 3 + #ifdef __ATOMIC_SEQ_CST + #define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), (delta), __ATOMIC_SEQ_CST) + #else + #define CV_XADD(addr, delta) __atomic_fetch_add((_Atomic(int)*)(addr), (delta), 5) + #endif #elif __GNUC__*10 + __GNUC_MINOR__ >= 42 #if !defined WIN32 && (defined __i486__ || defined __i586__ || \