]> granicus.if.org Git - icu/commitdiff
ICU-12505 U_HAVE_STD_ATOMICS, reduce & simplify configure options. (#52)
authorAndy Heninger <andy.heninger@gmail.com>
Tue, 14 Aug 2018 01:25:05 +0000 (18:25 -0700)
committerShane Carr <shane@unicode.org>
Thu, 27 Sep 2018 21:27:38 +0000 (14:27 -0700)
icu4c/source/common/putilimp.h
icu4c/source/configure
icu4c/source/configure.ac

index 8b858df9e3b46e46c0f4d0861c03aa6d1a9924c1..c43302d16c43c80a7f17d9ce824f7166a628abf6 100644 (file)
@@ -204,30 +204,18 @@ typedef size_t uintptr_t;
 
 /**
  * \def U_HAVE_STD_ATOMICS
- * Defines whether the standard C++11 <atomic> is available.
- * ICU will use this when available,
- * otherwise will fall back to compiler or platform specific alternatives.
+ * Defines whether to use the standard C++11 <atomic> functions
+ * If false, ICU will fall back to compiler or platform specific alternatives.
+ * Note: support for these fall back options for atomics will be removed in a future version
+ *       of ICU, and the use of C++ 11 atomics will be required.
  * @internal
  */
 #ifdef U_HAVE_STD_ATOMICS
     /* Use the predefined value. */
-#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
-    /* Clang 3.1, has atomic variable initializer bug. */
-#   define U_HAVE_STD_ATOMICS 0
-#else 
-    /* U_HAVE_ATOMIC is typically set by an autoconf test of #include <atomic>  */
-    /*   Can be set manually, or left undefined, on platforms without autoconf. */
-#   if defined(U_HAVE_ATOMIC) &&  U_HAVE_ATOMIC 
-#      define U_HAVE_STD_ATOMICS 1
-#   else
-#      define U_HAVE_STD_ATOMICS 0
-#   endif
+#else
+#    define U_HAVE_STD_ATOMICS 1
 #endif
 
-
 /**
  *  \def U_HAVE_CLANG_ATOMICS
  *  Defines whether Clang c11 style built-in atomics are available.
index a54a2291a3d6061de3e5b95879cf0589262e89ce..897ce589373baf60b9c7a453705d9d87f10cd3e6 100755 (executable)
@@ -673,7 +673,6 @@ U_HAVE_INTTYPES_H
 GENCCODE_ASSEMBLY
 HAVE_MMAP
 LIB_THREAD
-U_HAVE_ATOMIC
 ENABLE_RPATH
 U_ENABLE_DYLOAD
 U_HAVE_PLUGINS
@@ -6059,37 +6058,6 @@ $as_echo "$as_me: Adding CXXFLAGS option -std=c++11" >&6;}
     fi
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if #include <atomic> works" >&5
-$as_echo_n "checking if #include <atomic> works... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <atomic>
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_cv_header_atomic=yes
-else
-  ac_cv_header_atomic=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_atomic" >&5
-$as_echo "$ac_cv_header_atomic" >&6; }
-if test $ac_cv_header_atomic = yes
-then
-       U_HAVE_ATOMIC=1
-else
-        U_HAVE_ATOMIC=0
-fi
-# Make this available via CPPFLAGS
-CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_ATOMIC=${U_HAVE_ATOMIC}"
-
-
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
index 1f42887356edde921541c08bca62056bc20cc6be..747b583e98124568dc216a0d79a1077257052f81 100644 (file)
@@ -527,19 +527,6 @@ if [[ "$GXX" = yes ]]; then
     fi
 fi
 
-AC_MSG_CHECKING([[if #include <atomic> works]])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <atomic>]], [[]])], [ac_cv_header_atomic=yes], [ac_cv_header_atomic=no])
-AC_MSG_RESULT($ac_cv_header_atomic)
-if test $ac_cv_header_atomic = yes
-then
-       U_HAVE_ATOMIC=1
-else
-        U_HAVE_ATOMIC=0
-fi
-# Make this available via CPPFLAGS
-CONFIG_CPPFLAGS="${CONFIG_CPPFLAGS} -DU_HAVE_ATOMIC=${U_HAVE_ATOMIC}"
-AC_SUBST(U_HAVE_ATOMIC)
-
 AC_LANG_POP([C++])
 
 # Always build ICU with multi-threading support.