Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Unity-Technologies/libatomic_ops.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2017-11-28 22:11:15 +0300
committerIvan Maidanski <ivmai@mail.ru>2017-11-30 18:52:14 +0300
commite8d559f5be67befec44c839809b2941295c03988 (patch)
tree2221ffb6721df4cc0a56704e2bf65cd51835ebda
parent2258660c6adc4ad6eb56e950cbeffedc50e9fbb0 (diff)
Define AO_TS_SET to true (1) if GCC atomic_test_and_set is used
(fix commit 3315a03) According to GCC manual about the built-in functions for memory model aware atomic operations, __atomic_test_and_set returns bool value; bool true is encoded as 1. * src/atomic_ops/sysdeps/test_and_set_t_is_char.h [AO_PREFER_GENERALIZED || !__GCC_ATOMIC_TEST_AND_SET_TRUEVAL] (AO_TS_SET_TRUEVAL): Define to 1 (instead of 0xff).
-rw-r--r--src/atomic_ops/sysdeps/test_and_set_t_is_char.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/atomic_ops/sysdeps/test_and_set_t_is_char.h b/src/atomic_ops/sysdeps/test_and_set_t_is_char.h
index 75df9c0..9eb250c 100644
--- a/src/atomic_ops/sysdeps/test_and_set_t_is_char.h
+++ b/src/atomic_ops/sysdeps/test_and_set_t_is_char.h
@@ -26,11 +26,13 @@
* all zeroes, and the "set" value contains all ones typically.
*/
-#if defined(AO_GCC_ATOMIC_TEST_AND_SET) && !defined(AO_PREFER_GENERALIZED) \
- && defined(__GCC_ATOMIC_TEST_AND_SET_TRUEVAL)
+#ifndef AO_GCC_ATOMIC_TEST_AND_SET
+# define AO_TS_SET_TRUEVAL 0xff
+#elif defined(__GCC_ATOMIC_TEST_AND_SET_TRUEVAL) \
+ && !defined(AO_PREFER_GENERALIZED)
# define AO_TS_SET_TRUEVAL __GCC_ATOMIC_TEST_AND_SET_TRUEVAL
#else
-# define AO_TS_SET_TRUEVAL 0xff
+# define AO_TS_SET_TRUEVAL 1 /* true */
#endif
typedef enum {