]> granicus.if.org Git - libatomic_ops/commitdiff
Fix 'AO_*_TS_T is not defined' compiler warnings (GCC-8)
authorMax Horn <max@quendi.de>
Wed, 2 Jan 2019 14:47:21 +0000 (15:47 +0100)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 3 Jan 2019 16:39:53 +0000 (19:39 +0300)
* 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.

src/atomic_ops.h
src/atomic_ops/generalize.h

index 6d0c60d14f94affdd0fd72189ef7dedc2a9d771e..1373a2d3ae1a17b4a541a13a0b88ec04e0f0a986 100644 (file)
 
 /* 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
index 6edeab4a45d23158cbc5a18afd475a87b77eb698..73b06ed1035e7156759d745c04acd12d43564c05 100644 (file)
@@ -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) \
 #   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)
 #   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)
     {
 #   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)
     {
 #   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)
     {
 #   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)
     {