summaryrefslogtreecommitdiff
path: root/include/atomic
diff options
context:
space:
mode:
authorDavi Arnaut <davi.arnaut@oracle.com>2010-07-27 10:25:11 -0300
committerDavi Arnaut <davi.arnaut@oracle.com>2010-07-27 10:25:11 -0300
commit8ee568cde7bef3893f5500d07ef45cb58107cff3 (patch)
tree43e6827b58392e32d28c30ab4d16616696ac9f46 /include/atomic
parent37b8fa0b2b84f5a4800fc30259dc892102a9f067 (diff)
downloadmariadb-git-8ee568cde7bef3893f5500d07ef45cb58107cff3.tar.gz
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.
Diffstat (limited to 'include/atomic')
-rw-r--r--include/atomic/solaris.h8
1 files changed, 7 insertions, 1 deletions
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, \