Is something different being done in ocl.cpp where it would change the behavior of CV_XADD?

asked 2020-02-12 08:55:17 -0600

JWilliams gravatar image

I have a situation where I am trying to build the OpenCV core 4.2.0 in Embarcadero C++ Builder 10.2.x and when the core module gets to ocl.cpp it raises over 40 errors related to IMPLEMENT_REFCOUNTABLE macro. When I exam how CV_XADD is being resolved, it resolves to __c11_atomic_fetch_add((_Atomic (int)*)(addr), delta, __ATOMIC_ACQ_REL).

I have checked this intrinsic and I have no issues with it from a quick console application. I have no issue with the macro CV_XADD when used in a quick console application. I don't get errors on any other OpenCV source file that uses this resolved version of the macro. Does anyone have any idea of why this specific source file is complaining about it?

If I substitute the above resolved intrinsic to (int)__atomic_fetch_add((unsigned*)(addr), (unsigned)(delta), __ATOMIC_ACQ_REL) then source ocl.cpp compiles and the entire DLL module for core compiles.

I am stumped on this because CV_XADD is used in other source files within the core and none of them complain, so why just this file?

Thanks,

edit retag flag offensive close merge delete