View | Details | Raw Unified | Return to bug 209590
Collapse All | Expand All

(-)emulators/qemu-sbruno/files/patch-qemu-include-qemu-atomic.h (+28 lines)
Line 0 Link Here
1
--- a/include/qemu/atomic.h	2016-04-28 16:42:13 UTC
2
+++ b/include/qemu/atomic.h
3
@@ -136,10 +136,12 @@
4
 /* Provide shorter names for GCC atomic builtins, return old value */
5
 #define atomic_fetch_inc(ptr)  __atomic_fetch_add(ptr, 1, __ATOMIC_SEQ_CST)
6
 #define atomic_fetch_dec(ptr)  __atomic_fetch_sub(ptr, 1, __ATOMIC_SEQ_CST)
7
+#ifndef __cplusplus
8
 #define atomic_fetch_add(ptr, n) __atomic_fetch_add(ptr, n, __ATOMIC_SEQ_CST)
9
 #define atomic_fetch_sub(ptr, n) __atomic_fetch_sub(ptr, n, __ATOMIC_SEQ_CST)
10
 #define atomic_fetch_and(ptr, n) __atomic_fetch_and(ptr, n, __ATOMIC_SEQ_CST)
11
 #define atomic_fetch_or(ptr, n)  __atomic_fetch_or(ptr, n, __ATOMIC_SEQ_CST)
12
+#endif
13
 
14
 /* And even shorter names that return void.  */
15
 #define atomic_inc(ptr)    ((void) __atomic_fetch_add(ptr, 1, __ATOMIC_SEQ_CST))
16
@@ -330,10 +332,12 @@
17
 /* Provide shorter names for GCC atomic builtins.  */
18
 #define atomic_fetch_inc(ptr)  __sync_fetch_and_add(ptr, 1)
19
 #define atomic_fetch_dec(ptr)  __sync_fetch_and_add(ptr, -1)
20
+#ifndef __cplusplus
21
 #define atomic_fetch_add       __sync_fetch_and_add
22
 #define atomic_fetch_sub       __sync_fetch_and_sub
23
 #define atomic_fetch_and       __sync_fetch_and_and
24
 #define atomic_fetch_or        __sync_fetch_and_or
25
+#endif
26
 #define atomic_cmpxchg         __sync_val_compare_and_swap
27
 
28
 /* And even shorter names that return void.  */

Return to bug 209590