summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Horn <max@quendi.de>2019-01-02 15:47:21 +0100
committerIvan Maidanski <ivmai@mail.ru>2019-01-03 19:39:53 +0300
commit159338969c0c57c43027e9f1349c01d458f0b03e (patch)
tree87bb02945bac5549aa28778dd3e9aa10f4586e8f /src
parenteec5eafb3ed6daffa3b62de02dacc0e962ddb92b (diff)
downloadlibatomic_ops-159338969c0c57c43027e9f1349c01d458f0b03e.tar.gz
Fix 'AO_*_TS_T is not defined' compiler warnings (GCC-8)
* src/atomic_ops.h [!AO_HAVE_CLEAR]: Replace "AO_AO_TS_T" with "defined(AO_AO_TS_T)" and AO_CHAR_TS_T" with "defined(AO_CHAR_TS_T)", respectively, in the "if" preprocessor directives. * src/atomic_ops/generalize.h: Likewise.
Diffstat (limited to 'src')
-rw-r--r--src/atomic_ops.h4
-rw-r--r--src/atomic_ops/generalize.h22
2 files changed, 14 insertions, 12 deletions
diff --git a/src/atomic_ops.h b/src/atomic_ops.h
index 6d0c60d..1373a2d 100644
--- a/src/atomic_ops.h
+++ b/src/atomic_ops.h
@@ -421,11 +421,11 @@
/* The most common way to clear a test-and-set location */
/* at the end of a critical section. */
-#if AO_AO_TS_T && !defined(AO_HAVE_CLEAR)
+#if defined(AO_AO_TS_T) && !defined(AO_HAVE_CLEAR)
# define AO_CLEAR(addr) AO_store_release((AO_TS_t *)(addr), AO_TS_CLEAR)
# define AO_HAVE_CLEAR
#endif
-#if AO_CHAR_TS_T && !defined(AO_HAVE_CLEAR)
+#if defined(AO_CHAR_TS_T) && !defined(AO_HAVE_CLEAR)
# define AO_CLEAR(addr) AO_char_store_release((AO_TS_t *)(addr), AO_TS_CLEAR)
# define AO_HAVE_CLEAR
#endif
diff --git a/src/atomic_ops/generalize.h b/src/atomic_ops/generalize.h
index 6edeab4..73b06ed 100644
--- a/src/atomic_ops/generalize.h
+++ b/src/atomic_ops/generalize.h
@@ -99,7 +99,7 @@
# define AO_HAVE_compare_and_swap_release
# endif
-# if AO_CHAR_TS_T
+# if defined(AO_CHAR_TS_T)
# define AO_TS_COMPARE_AND_SWAP_FULL(a,o,n) \
AO_char_compare_and_swap_full(a,o,n)
# define AO_TS_COMPARE_AND_SWAP_ACQUIRE(a,o,n) \
@@ -109,7 +109,7 @@
# define AO_TS_COMPARE_AND_SWAP(a,o,n) AO_char_compare_and_swap(a,o,n)
# endif
-# if AO_AO_TS_T
+# if defined(AO_AO_TS_T)
# define AO_TS_COMPARE_AND_SWAP_FULL(a,o,n) AO_compare_and_swap_full(a,o,n)
# define AO_TS_COMPARE_AND_SWAP_ACQUIRE(a,o,n) \
AO_compare_and_swap_acquire(a,o,n)
@@ -118,8 +118,8 @@
# define AO_TS_COMPARE_AND_SWAP(a,o,n) AO_compare_and_swap(a,o,n)
# endif
-# if (AO_AO_TS_T && defined(AO_HAVE_compare_and_swap_full)) \
- || (AO_CHAR_TS_T && defined(AO_HAVE_char_compare_and_swap_full))
+# if (defined(AO_AO_TS_T) && defined(AO_HAVE_compare_and_swap_full)) \
+ || (defined(AO_CHAR_TS_T) && defined(AO_HAVE_char_compare_and_swap_full))
AO_INLINE AO_TS_VAL_t
AO_test_and_set_full(volatile AO_TS_t *addr)
{
@@ -131,8 +131,9 @@
# define AO_HAVE_test_and_set_full
# endif /* AO_HAVE_compare_and_swap_full */
-# if (AO_AO_TS_T && defined(AO_HAVE_compare_and_swap_acquire)) \
- || (AO_CHAR_TS_T && defined(AO_HAVE_char_compare_and_swap_acquire))
+# if (defined(AO_AO_TS_T) && defined(AO_HAVE_compare_and_swap_acquire)) \
+ || (defined(AO_CHAR_TS_T) \
+ && defined(AO_HAVE_char_compare_and_swap_acquire))
AO_INLINE AO_TS_VAL_t
AO_test_and_set_acquire(volatile AO_TS_t *addr)
{
@@ -144,8 +145,9 @@
# define AO_HAVE_test_and_set_acquire
# endif /* AO_HAVE_compare_and_swap_acquire */
-# if (AO_AO_TS_T && defined(AO_HAVE_compare_and_swap_release)) \
- || (AO_CHAR_TS_T && defined(AO_HAVE_char_compare_and_swap_release))
+# if (defined(AO_AO_TS_T) && defined(AO_HAVE_compare_and_swap_release)) \
+ || (defined(AO_CHAR_TS_T) \
+ && defined(AO_HAVE_char_compare_and_swap_release))
AO_INLINE AO_TS_VAL_t
AO_test_and_set_release(volatile AO_TS_t *addr)
{
@@ -157,8 +159,8 @@
# define AO_HAVE_test_and_set_release
# endif /* AO_HAVE_compare_and_swap_release */
-# if (AO_AO_TS_T && defined(AO_HAVE_compare_and_swap)) \
- || (AO_CHAR_TS_T && defined(AO_HAVE_char_compare_and_swap))
+# if (defined(AO_AO_TS_T) && defined(AO_HAVE_compare_and_swap)) \
+ || (defined(AO_CHAR_TS_T) && defined(AO_HAVE_char_compare_and_swap))
AO_INLINE AO_TS_VAL_t
AO_test_and_set(volatile AO_TS_t *addr)
{