]> granicus.if.org Git - icu/commitdiff
ICU-11599 simplify preprocessor conditions for U_HAVE_CLANG_ATOMICS
authorMarkus Scherer <markus.icu@gmail.com>
Wed, 15 Jul 2015 20:04:11 +0000 (20:04 +0000)
committerMarkus Scherer <markus.icu@gmail.com>
Wed, 15 Jul 2015 20:04:11 +0000 (20:04 +0000)
X-SVN-Rev: 37667

icu4c/source/common/putilimp.h
icu4c/source/common/unicode/platform.h

index 49c41c418d4ce5c5d6b30647fd5167e7c3207405..5de801f56a6547095edf95bc43d6130e74fbb886 100644 (file)
@@ -212,7 +212,7 @@ typedef size_t uintptr_t;
  */
 #ifdef U_HAVE_STD_ATOMICS
     /* Use the predefined value. */
-#elif !defined(__cplusplus) || __cplusplus<201103L
+#elif U_CPLUSPLUS_VERSION < 11
     /* Not C++11, disable use of atomics */
 #   define U_HAVE_STD_ATOMICS 0
 #elif __clang__ && __clang_major__==3 && __clang_minor__<=1
@@ -236,10 +236,7 @@ typedef size_t uintptr_t;
  */
 #ifdef U_HAVE_CLANG_ATOMICS
     /* Use the predefined value. */
-#elif !defined(__clang__)
-#    define U_HAVE_CLANG_ATOMICS 0
-#else
-#if __has_builtin(__c11_atomic_load) && \
+#elif __has_builtin(__c11_atomic_load) && \
     __has_builtin(__c11_atomic_store) && \
     __has_builtin(__c11_atomic_fetch_add) && \
     __has_builtin(__c11_atomic_fetch_sub)
@@ -247,7 +244,6 @@ typedef size_t uintptr_t;
 #else
 #    define U_HAVE_CLANG_ATOMICS 0
 #endif
-#endif
 
 /*===========================================================================*/
 /** @{ Programs used by ICU code                                             */
index 8534eca6be12fc43b7577027629053bff4701b72..138c2d5cad696a8006403da4ad4f0fd6e7c754c3 100644 (file)
 #ifndef __has_attribute
 #    define __has_attribute(x) 0
 #endif
+#ifndef __has_builtin
+#    define __has_builtin(x) 0
+#endif
 #ifndef __has_feature
 #    define __has_feature(x) 0
 #endif