Remove CDS_CXX11_ATOMIC_SUPPORT
authorkhizmax <libcds.dev@gmail.com>
Sat, 20 Sep 2014 15:56:16 +0000 (19:56 +0400)
committerkhizmax <libcds.dev@gmail.com>
Sat, 20 Sep 2014 15:56:16 +0000 (19:56 +0400)
cds/compiler/clang/defs.h
cds/compiler/gcc/compiler_macro.h
cds/compiler/gcc/cxx11_atomic_patches.h
cds/compiler/gcc/defs.h
cds/compiler/icl/cxx11_atomic_patches_win.h
cds/compiler/icl/defs.h
cds/compiler/vc/defs.h
cds/cxx11_atomic.h

index af1239bafe76eadb6241a3f33ec8cf24f729c635..c17115ac462a1400547193df83bc0712b346d89a 100644 (file)
 #define  CDS_COMPILER__NAME    ("clang " __clang_version__)
 #define  CDS_COMPILER__NICK    "clang"
 
-// C++11 atomic support - only for libc++
-// Note: Clang libc++ atomic leads to program crash.
-// So, we use libcds atomic implementation
-//#if __has_feature(cxx_atomic) && defined(_LIBCPP_VERSION)
-//#   define CDS_CXX11_ATOMIC_SUPPORT     1
-//#endif
-
+#if defined(_LIBCPP_VERSION)
+    // Note: Clang libc++ atomic leads to program crash.
+    // So, we use libcds atomic implementation
+#   define CDS_USE_LIBCDS_ATOMIC
+#endif
 
 #include <cds/compiler/gcc/compiler_macro.h>
 
-
 #define alignof __alignof__
 
 // Variadic template support (only if -std=c++0x compile-line option provided)
index c9e89bcbb47a635b0d8b47c1c5a29b47bdaa6392..3617dbe3783b06525f4ca91ea6ee8bf0e52a86cd 100644 (file)
 #else
 #   if defined(CDS_USE_LIBCDS_ATOMIC)
 #       error "Libcds does not support atomic implementation for the processor architecture. Try to use C++11-compatible compiler and remove CDS_USE_LIBCDS_ATOMIC flag from compiler command line"
-#   elif !defined(CDS_USE_BOOST_ATOMIC) && !defined(CDS_CXX11_ATOMIC_SUPPORT)
-#       error "The current compiler does not support C++11 atomic. Try to use boost.atomic (-DCDS_USE_BOOST_ATOMIC) or C++11 compiler"
 #   else
 #       define CDS_PROCESSOR_ARCH    CDS_PROCESSOR_UNKNOWN
 #       define CDS_BUILD_BITS        32
index c6818878d028b77b806a8f2fbe72ea23e60eba01..62faf5dfc58bd2191496acc2395e824834857dc4 100644 (file)
@@ -3,45 +3,4 @@
 #ifndef __CDS_COMPILER_GCC_CXX11_ATOMIC_PATCHES_H
 #define __CDS_COMPILER_GCC_CXX11_ATOMIC_PATCHES_H
 
-#if CDS_CXX11_ATOMIC_SUPPORT == 1
-#   if CDS_COMPILER_VERSION >= 40600 && CDS_COMPILER_VERSION < 40700
-    // GCC 4.6.x has no atomic_thread_fence/atomic_signal_fence
-    namespace std {
-        inline void atomic_thread_fence(memory_order order)
-        {
-            switch(order)
-            {
-            case memory_order_relaxed:
-            case memory_order_consume:
-                break;
-            case memory_order_release:
-            case memory_order_acquire:
-            case memory_order_acq_rel:
-            case memory_order_seq_cst:
-                __sync_synchronize();
-                break;
-            default:;
-            }
-
-        }
-        inline void atomic_signal_fence(memory_order order)
-        {
-            switch(order)
-            {
-            case memory_order_relaxed:
-                break;
-            case memory_order_consume:
-            case memory_order_release:
-            case memory_order_acquire:
-            case memory_order_acq_rel:
-            case memory_order_seq_cst:
-                CDS_COMPILER_RW_BARRIER;
-                break;
-            default:;
-            }
-        }
-    } // namespace std
-#   endif
-#endif
-
 #endif // #ifndef __CDS_COMPILER_GCC_CXX11_ATOMIC_PATCHES_H
index 0df786ddf253cf36633525e8037c2f9990f3ed29..682fcd1b31f5b4e1a5ed9b5736671d6a3b22bc34 100644 (file)
@@ -6,8 +6,8 @@
 // Compiler version
 #define CDS_COMPILER_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
 
-#if CDS_COMPILER_VERSION < 40300
-#   error "Compiler version error. GCC version 4.3.0 and above is supported"
+#if CDS_COMPILER_VERSION < 40800
+#   error "Compiler version error. GCC version 4.8.0 and above is supported"
 #endif
 
 // Compiler name
 #endif
 #define  CDS_COMPILER__NICK        "gcc"
 
-// C++11 atomic support
-#if CDS_COMPILER_VERSION >= 40700
-#   define CDS_CXX11_ATOMIC_SUPPORT     1
-#elif defined(CDS_CXX11_ATOMIC_GCC)
-#   define CDS_CXX11_ATOMIC_SUPPORT     1
-#endif
-
-
 #include <cds/compiler/gcc/compiler_macro.h>
 
 
index b5719d7ea66eca7549d5973ea2b85e61e6e712ef..06249f37f103345d20027223c34957d408b11564 100644 (file)
@@ -3,25 +3,4 @@
 #ifndef __CDS_COMPILER_ICL_CXX11_ATOMIC_PATCHES_WIN_H
 #define __CDS_COMPILER_ICL_CXX11_ATOMIC_PATCHES_WIN_H
 
-//@cond
-#if CDS_COMPILER == CDS_COMPILER_INTEL && CDS_CXX11_ATOMIC_SUPPORT == 1 && _MSC_VER < 1700
-
-namespace std {
-    typedef std::atomic<size_t> atomic_size_t;
-
-    // Fences
-    static inline void atomic_thread_fence(memory_order order) CDS_NOEXCEPT
-    {
-        CDS_COMPILER_RW_BARRIER;
-    }
-    static inline void atomic_signal_fence(memory_order order) CDS_NOEXCEPT
-    {
-        CDS_COMPILER_RW_BARRIER;
-    }
-
-}
-
-#endif
-//@endcond
-
 #endif // #ifndef __CDS_COMPILER_ICL_CXX11_ATOMIC_PATCHES_WIN_H
index 5f2809b38904f484f1b1c98e4ef8f3b747648354..e43603df5b05de4130d01eedc95de3e1c317e0c1 100644 (file)
 #   define alignof __alignof__
 #endif
 
-//#if CDS_COMPILER_VERSION < 1600
-//#   include <boost/static_assert.hpp>
-//#   define static_assert(_expr, _msg)     BOOST_STATIC_ASSERT((_expr))
-//#endif
-
 // Memory leaks detection (debug build only)
 //#ifdef _DEBUG
 //#   define _CRTDBG_MAP_ALLOC
 #   define CDS_NOEXCEPT_SUPPORT_(expr) noexcept(expr)
 #endif
 
-// C++11 atomic support
-#if CDS_COMPILER_VERSION >= 1300 && CDS_OS_INTERFACE == CDS_OSI_WINDOWS && _MSC_VER >= 1700
-    // Intel C++ 13 supports C++11 atomic standard for VC++ 2012
-#   define CDS_CXX11_ATOMIC_SUPPORT     1
-#endif
-
 
 // Lambda (ICL 12 +)
 #if CDS_COMPILER_VERSION >= 1200
index f927231758b6596a2ec71d220e095e9b0cb833b1..e8d14ba3aafafaa06497640cda03359f265c8461 100644 (file)
@@ -87,9 +87,6 @@
 #define CDS_NOEXCEPT_SUPPORT
 #define CDS_NOEXCEPT_SUPPORT_(expr)
 
-// C++11 atomic support
-#define CDS_CXX11_ATOMIC_SUPPORT     1
-
 // Lambda (VC 10 +)
 //#define CDS_CXX11_LAMBDA_SUPPORT
 
index d61a49a6c3df612fbb483be6f253d5fcadac36a3..f54ec19ad789effb115ffb3fe5e1aafbacbe3989 100644 (file)
@@ -91,6 +91,7 @@ namespace cxx11_atomics {
 
 //@cond
 #if defined(CDS_USE_BOOST_ATOMIC)
+    // boost atomic
 #   include <boost/version.hpp>
 #   if BOOST_VERSION >= 105400
 #       include <boost/atomic.hpp>
@@ -100,8 +101,14 @@ namespace cxx11_atomics {
 #   else
 #       error "Boost version 1.54 or above is needed for boost.atomic"
 #   endif
-#elif CDS_CXX11_ATOMIC_SUPPORT == 1 && !defined(CDS_USE_LIBCDS_ATOMIC)
-    // Compiler supports C++11 atomic (conditionally defined in cds/details/defs.h)
+#elif defined(CDS_USE_LIBCDS_ATOMIC)
+    // libcds atomic
+#   include <cds/compiler/cxx11_atomic.h>
+#   define CDS_ATOMIC cds::cxx11_atomics
+#   define CDS_CXX11_ATOMIC_BEGIN_NAMESPACE namespace cds { namespace cxx11_atomics {
+#   define CDS_CXX11_ATOMIC_END_NAMESPACE }}
+#else
+    // Compiler provided C++11 atomic
 #   include <cds/compiler/cxx11_atomic_prepatches.h>
 #   include <atomic>
 #   define CDS_ATOMIC std
@@ -109,10 +116,6 @@ namespace cxx11_atomics {
 #   define CDS_CXX11_ATOMIC_END_NAMESPACE }
 #   include <cds/compiler/cxx11_atomic_patches.h>
 #else
-#   include <cds/compiler/cxx11_atomic.h>
-#   define CDS_ATOMIC cds::cxx11_atomics
-#   define CDS_CXX11_ATOMIC_BEGIN_NAMESPACE namespace cds { namespace cxx11_atomics {
-#   define CDS_CXX11_ATOMIC_END_NAMESPACE }}
 #endif
 //@endcond