From c6a34a99616c749c1d4874c9e7f7424fd2765de6 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Tue, 27 Jul 2010 10:25:11 -0300 Subject: [PATCH] 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. --- include/atomic/solaris.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/atomic/solaris.h b/include/atomic/solaris.h index fc9f369c707..5643f878cd2 100644 --- a/include/atomic/solaris.h +++ b/include/atomic/solaris.h @@ -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, \