From: Eric Pouech epouech@codeweavers.com
clang++ generates an error when an intrinsic function is redefined as an inline function. Note the _InterlockedCompareExchange128 for a x86_64 machine is only defined as intrinsic when -mcx16 option is enabled. But we use always use the intrinsic definition on x86_64 so that compilation done without the -mcx16 could be detected (on C++ only). And the intrinsic has been added recently to aarch64 machine for clang. So, it's detected thanks to __has_builtin() macro.
(thanks to Jacek for some insights on clang)
Signed-off-by: Eric Pouech epouech@codeweavers.com --- include/winnt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/winnt.h b/include/winnt.h index fd7b37cb1c0..041aa4a36be 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -7186,7 +7186,7 @@ static FORCEINLINE DECLSPEC_NORETURN void __fastfail(unsigned int code)
#define InterlockedCompareExchange128 _InterlockedCompareExchange128
-#if defined(_MSC_VER) && !defined(__clang__) +#if defined(_MSC_VER) && (!defined(__clang__) || !defined(__aarch64__) || WINE__HAS_BUILTIN(_InterlockedCompareExchange128))
#pragma intrinsic(_InterlockedCompareExchange128) unsigned char _InterlockedCompareExchange128(volatile __int64 *, __int64, __int64, __int64 *);