mirror of
https://github.com/opencv/opencv.git
synced 2025-06-08 01:53:19 +08:00
Merge pull request #7553 from erichkeane:interlocked_add_fix
This commit is contained in:
commit
9b2b8404a0
@ -418,10 +418,7 @@ Cv64suf;
|
|||||||
* exchange-add operation for atomic operations on reference counters *
|
* exchange-add operation for atomic operations on reference counters *
|
||||||
\****************************************************************************************/
|
\****************************************************************************************/
|
||||||
|
|
||||||
#if defined __INTEL_COMPILER && !(defined WIN32 || defined _WIN32)
|
#if defined __GNUC__
|
||||||
// atomic increment on the linux version of the Intel(tm) compiler
|
|
||||||
# define CV_XADD(addr, delta) (int)_InterlockedExchangeAdd(const_cast<void*>(reinterpret_cast<volatile void*>(addr)), delta)
|
|
||||||
#elif defined __GNUC__
|
|
||||||
# if defined __clang__ && __clang_major__ >= 3 && !defined __ANDROID__ && !defined __EMSCRIPTEN__ && !defined(__CUDACC__)
|
# if defined __clang__ && __clang_major__ >= 3 && !defined __ANDROID__ && !defined __EMSCRIPTEN__ && !defined(__CUDACC__)
|
||||||
# ifdef __ATOMIC_ACQ_REL
|
# ifdef __ATOMIC_ACQ_REL
|
||||||
# define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), delta, __ATOMIC_ACQ_REL)
|
# define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), delta, __ATOMIC_ACQ_REL)
|
||||||
|
Loading…
Reference in New Issue
Block a user