diff options
author | Roland McGrath <roland@gnu.org> | 2003-03-26 04:02:03 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2003-03-26 04:02:03 +0000 |
commit | 859e708f0e44d50deff617c7fd939f4fba295afb (patch) | |
tree | c02276928e6c984391f089af6b54f81220165d0e /include | |
parent | dd410d4d4585883d02aa497f4227551c5c4cf811 (diff) | |
download | glibc-859e708f0e44d50deff617c7fd939f4fba295afb.zip glibc-859e708f0e44d50deff617c7fd939f4fba295afb.tar.gz glibc-859e708f0e44d50deff617c7fd939f4fba295afb.tar.bz2 |
* csu/tst-atomic.c (do_test): Add some new
atomic_compare_and_exchange_val_acq, atomic_add_zero,
atomic_compare_and_exchange_bool_acq and atomic_add_negative tests.
* include/atomic.h (atomic_add_negative, atomic_add_zero):
Prefix local variable so that it doesn't clash with the one
in atomic_exchange_and_add.
* sysdeps/ia64/bits/atomic.h (atomic_exchange): Fix for long/void *
pointers.
(atomic_exchange_and_add): Implement using __sync_fetch_and_add_?i.
* sysdeps/powerpc/bits/atomic.h (atomic_exchange_and_add): Force
value into register.
* sysdeps/s390/bits/atomic.h (__arch_compare_and_exchange_val_64_acq):
Cast newval to long.
* sysdeps/x86_64/bits/atomic.h
(__arch_compare_and_exchange_val_64_acq): Cast newval and oldval to
long.
(atomic_exchange): Cast newvalue to long if sizeof == 8.
(atomic_exchange_and_add): Cast value to long if sizeof == 8.
(atomic_add, atomic_add_negative, atomic_add_zero): Likewise.
(atomic_bit_set): Shift 1L up in all cases to shut up warnings.
Diffstat (limited to 'include')
-rw-r--r-- | include/atomic.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/atomic.h b/include/atomic.h index 56b0729..9889331 100644 --- a/include/atomic.h +++ b/include/atomic.h @@ -188,16 +188,16 @@ #ifndef atomic_add_negative -# define atomic_add_negative(mem, value) \ - ({ __typeof (value) __value = (value); \ - atomic_exchange_and_add ((mem), __value) < -__value; }) +# define atomic_add_negative(mem, value) \ + ({ __typeof (value) __aan_value = (value); \ + atomic_exchange_and_add ((mem), __aan_value) < -__aan_value; }) #endif #ifndef atomic_add_zero -# define atomic_add_zero(mem, value) \ - ({ __typeof (value) __value = (value); \ - atomic_exchange_and_add ((mem), __value) == -__value; }) +# define atomic_add_zero(mem, value) \ + ({ __typeof (value) __aaz_value = (value); \ + atomic_exchange_and_add ((mem), __aaz_value) == -__aaz_value; }) #endif |