Remove #ifdef that doesn't make sense anymore; extend clang workaround to

conver __sync_val_compare_and_swap.

ok jsg@
This commit is contained in:
kettenis 2020-04-03 10:06:14 +00:00
parent cd2d30e6df
commit b8fd44900b

View File

@ -163,10 +163,13 @@ __sync_val_compare_and_swap_4(uint32_t *ptr, uint32_t oldval, uint32_t newval)
#pragma redefine_extname __sync_sub_and_fetch_8_c __sync_sub_and_fetch_8
#pragma redefine_extname __sync_fetch_and_add_8_c __sync_fetch_and_add_8
#pragma redefine_extname __sync_fetch_and_sub_8_c __sync_fetch_and_sub_8
#pragma redefine_extname __sync_val_compare_and_swap_8_c \
__sync_val_compare_and_swap_8
#define __sync_add_and_fetch_8 __sync_add_and_fetch_8_c
#define __sync_sub_and_fetch_8 __sync_sub_and_fetch_8_c
#define __sync_fetch_and_add_8 __sync_fetch_and_add_8_c
#define __sync_fetch_and_sub_8 __sync_fetch_and_sub_8_c
#define __sync_val_compare_and_swap_8 __sync_val_compare_and_swap_8_c
#endif
WEAK uint64_t
@ -221,7 +224,6 @@ __sync_fetch_and_sub_8(uint64_t *ptr, uint64_t val)
return r;
}
#ifdef USE_GCC_ATOMIC_BUILTINS
WEAK uint64_t
__sync_val_compare_and_swap_8(uint64_t *ptr, uint64_t oldval, uint64_t newval)
{
@ -235,6 +237,5 @@ __sync_val_compare_and_swap_8(uint64_t *ptr, uint64_t oldval, uint64_t newval)
return r;
}
#endif /* USE_GCC_ATOMIC_BUILTINS */
#endif