From 9dbf370b213523ffe81fbe0f8f8641106901efb4 Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Wed, 15 Jul 2015 20:04:11 +0000 Subject: [PATCH] ICU-11599 simplify preprocessor conditions for U_HAVE_CLANG_ATOMICS X-SVN-Rev: 37667 --- icu4c/source/common/putilimp.h | 8 ++------ icu4c/source/common/unicode/platform.h | 3 +++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/icu4c/source/common/putilimp.h b/icu4c/source/common/putilimp.h index 49c41c418d4..5de801f56a6 100644 --- a/icu4c/source/common/putilimp.h +++ b/icu4c/source/common/putilimp.h @@ -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 */ diff --git a/icu4c/source/common/unicode/platform.h b/icu4c/source/common/unicode/platform.h index 8534eca6be1..138c2d5cad6 100644 --- a/icu4c/source/common/unicode/platform.h +++ b/icu4c/source/common/unicode/platform.h @@ -429,6 +429,9 @@ #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 -- 2.40.0