Bug#52261: 64 bit atomic operations do not work on Solaris i386 ..

Workaround a interface problem with the atomic macros that was
causing warnings. The correct type is retrieved using typeof if
compiling with GCC.
This commit is contained in:
Davi Arnaut 2010-07-27 10:25:11 -03:00
parent fce8b7e193
commit c6a34a9961

View File

@ -20,11 +20,17 @@
#define MY_ATOMIC_MODE "solaris-atomic"
#if defined(__GNUC__)
#define atomic_typeof(T,V) __typeof__(V)
#else
#define atomic_typeof(T,V) T
#endif
#define uintptr_t void *
#define atomic_or_ptr_nv(X,Y) (void *)atomic_or_ulong_nv((volatile ulong_t *)X, Y)
#define make_atomic_cas_body(S) \
uint ## S ## _t sav; \
atomic_typeof(uint ## S ## _t, *cmp) sav; \
sav = atomic_cas_ ## S( \
(volatile uint ## S ## _t *)a, \
(uint ## S ## _t)*cmp, \