compat/atomics: fix atomic_fetch_xor
authorJames Almer <jamrial@gmail.com>
Sun, 2 Apr 2017 03:57:17 +0000 (00:57 -0300)
committerJames Almer <jamrial@gmail.com>
Sun, 2 Apr 2017 03:57:17 +0000 (00:57 -0300)
compat/atomics/dummy/stdatomic.h
compat/atomics/gcc/stdatomic.h
compat/atomics/pthread/stdatomic.h
compat/atomics/suncc/stdatomic.h
compat/atomics/win32/stdatomic.h

index c26f629..59d85f9 100644 (file)
@@ -156,7 +156,7 @@ FETCH_MODIFY(and, &)
     atomic_fetch_or(object, operand)
 
 #define atomic_fetch_xor_explicit(object, operand, order) \
-    atomic_fetch_sub(object, operand)
+    atomic_fetch_xor(object, operand)
 
 #define atomic_fetch_and_explicit(object, operand, order) \
     atomic_fetch_and(object, operand)
index 2b64687..e13ed0e 100644 (file)
@@ -147,10 +147,10 @@ do {                                    \
     atomic_fetch_or(object, operand)
 
 #define atomic_fetch_xor(object, operand) \
-    __sync_fetch_and_sub(object, operand)
+    __sync_fetch_and_xor(object, operand)
 
 #define atomic_fetch_xor_explicit(object, operand, order) \
-    atomic_fetch_sub(object, operand)
+    atomic_fetch_xor(object, operand)
 
 #define atomic_fetch_and(object, operand) \
     __sync_fetch_and_and(object, operand)
index 1b7278e..81a60f1 100644 (file)
@@ -177,7 +177,7 @@ FETCH_MODIFY(and, &)
     atomic_fetch_or(object, operand)
 
 #define atomic_fetch_xor_explicit(object, operand, order) \
-    atomic_fetch_sub(object, operand)
+    atomic_fetch_xor(object, operand)
 
 #define atomic_fetch_and_explicit(object, operand, order) \
     atomic_fetch_and(object, operand)
index 119c2ba..4a864a4 100644 (file)
@@ -166,7 +166,7 @@ static inline intptr_t atomic_fetch_and(intptr_t *object, intptr_t operand)
     atomic_fetch_or(object, operand)
 
 #define atomic_fetch_xor_explicit(object, operand, order) \
-    atomic_fetch_sub(object, operand)
+    atomic_fetch_xor(object, operand)
 
 #define atomic_fetch_and_explicit(object, operand, order) \
     atomic_fetch_and(object, operand)
index 4cbba9c..fa7ef51 100644 (file)
@@ -159,7 +159,7 @@ static inline int atomic_compare_exchange_strong(intptr_t *object, intptr_t *exp
     atomic_fetch_or(object, operand)
 
 #define atomic_fetch_xor_explicit(object, operand, order) \
-    atomic_fetch_sub(object, operand)
+    atomic_fetch_xor(object, operand)
 
 #define atomic_fetch_and_explicit(object, operand, order) \
     atomic_fetch_and(object, operand)