[utils] Make sure we include WRAP_ATOMIC_INTRINSIC if needed
authorVlad Brezae <brezaevlad@gmail.com>
Tue, 14 Jan 2020 14:13:27 +0000 (16:13 +0200)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Tue, 14 Jan 2020 21:03:48 +0000 (22:03 +0100)
Currently, this doesn't impact any targets, but do it for consistency.

Fixes https://github.com/mono/mono/issues/10651

Commit migrated from https://github.com/mono/mono/commit/fef06df53729a7e0159660494b0ecc1c5b3fe0c7

src/mono/mono/utils/atomic.c

index 519448b..eac6be3 100644 (file)
@@ -508,7 +508,7 @@ void mono_atomic_store_ptr(volatile gpointer *dst, gpointer val)
 gint64
 mono_atomic_cas_i64(volatile gint64 *dest, gint64 exch, gint64 comp)
 {
-       return __sync_val_compare_and_swap (dest, comp, exch);
+       return gcc_sync_val_compare_and_swap (dest, comp, exch);
 }
 
 #elif defined (__arm__) && defined (HAVE_ARMV7) && (defined(TARGET_IOS) || defined(TARGET_WATCHOS) || defined(TARGET_ANDROID))
@@ -526,7 +526,7 @@ mono_atomic_cas_i64(volatile gint64 *dest, gint64 exch, gint64 comp)
 gint64
 mono_atomic_cas_i64(volatile gint64 *dest, gint64 exch, gint64 comp)
 {
-       return  __sync_val_compare_and_swap (dest, comp, exch);
+       return  gcc_sync_val_compare_and_swap (dest, comp, exch);
 }
 
 #elif defined (TARGET_ANDROID)