From: Erich Keane Date: Tue, 25 Oct 2016 21:18:55 +0000 (-0700) Subject: Correct cast for _InterlockedExchangeAdd on ICC X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1473^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=689cf79625ddecebad34486f347a8320602d3846;p=platform%2Fupstream%2Fopencv.git Correct cast for _InterlockedExchangeAdd on ICC A bug in ICC improperly identified the first parameter as "void*" rather than the proper "volatile long*". This is scheduled to be fixed in ICC in a future release. This patch casts only to a "long*" to preserve backwards compatibility with the ICC 16 and ICC 17 releases. --- diff --git a/modules/core/include/opencv2/core/cvdef.h b/modules/core/include/opencv2/core/cvdef.h index bfacd22..a4c1fc1 100644 --- a/modules/core/include/opencv2/core/cvdef.h +++ b/modules/core/include/opencv2/core/cvdef.h @@ -420,7 +420,7 @@ Cv64suf; #if defined __INTEL_COMPILER && !(defined WIN32 || defined _WIN32) // atomic increment on the linux version of the Intel(tm) compiler -# define CV_XADD(addr, delta) (int)_InterlockedExchangeAdd(const_cast(reinterpret_cast(addr)), delta) +# define CV_XADD(addr, delta) (int)_InterlockedExchangeAdd(const_cast(reinterpret_cast(addr)), delta) #elif defined __GNUC__ # if defined __clang__ && __clang_major__ >= 3 && !defined __ANDROID__ && !defined __EMSCRIPTEN__ && !defined(__CUDACC__) # ifdef __ATOMIC_ACQ_REL