From 28d9892aa2549b94dcfd08449cb5b763923b73c9 Mon Sep 17 00:00:00 2001 From: Andreas Beckmann Date: Mon, 27 Jun 2022 13:55:15 +0200 Subject: [PATCH] [PATCH 2/3] switch from __sync_add_and_fetch to __atomic_add_fetch Gbp-Pq: Name 1019-switch-from-__sync_add_and_fetch-to-__atomic_add_fet.patch --- lib/CL/pocl_cl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/CL/pocl_cl.h b/lib/CL/pocl_cl.h index 3600d5b..f064b5a 100644 --- a/lib/CL/pocl_cl.h +++ b/lib/CL/pocl_cl.h @@ -77,9 +77,9 @@ typedef pthread_t pocl_thread_t; #if defined(__GNUC__) || defined(__clang__) /* These return the new value. */ -/* See: https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html */ -#define POCL_ATOMIC_INC(x) __sync_add_and_fetch (&x, 1) -#define POCL_ATOMIC_DEC(x) __sync_sub_and_fetch (&x, 1) +/* See: https://gcc.gnu.org/onlinedocs/gcc-4.7.4/gcc/_005f_005fatomic-Builtins.html */ +#define POCL_ATOMIC_INC(x) __atomic_add_fetch (&x, 1, __ATOMIC_SEQ_CST) +#define POCL_ATOMIC_DEC(x) __atomic_sub_fetch (&x, 1, __ATOMIC_SEQ_CST) #elif defined(_WIN32) #define POCL_ATOMIC_INC(x) InterlockedIncrement64 (&x) -- 2.30.2