From 01b28a0ae13ddd491a6e67d17780df543ce72ab9 Mon Sep 17 00:00:00 2001 From: khizmax Date: Tue, 23 Sep 2014 22:24:45 +0400 Subject: [PATCH] Remove CDS_CXX11_DELETE_DEFINITION_SUPPORT and emulating code --- cds/compiler/clang/defs.h | 3 -- cds/compiler/cxx11_atomic.h | 53 +-------------------------- cds/compiler/defs.h | 1 + cds/compiler/gcc/defs.h | 3 -- cds/compiler/icl/defs.h | 3 -- cds/compiler/vc/defs.h | 3 -- cds/details/cxx11_features.h | 19 ---------- cds/details/defs.h | 2 - cds/details/marked_ptr.h | 2 - doxygen/cds.doxy | 1 - projects/Win/vc12/cds.vcxproj | 1 - projects/Win/vc12/cds.vcxproj.filters | 3 -- 12 files changed, 2 insertions(+), 92 deletions(-) delete mode 100644 cds/details/cxx11_features.h diff --git a/cds/compiler/clang/defs.h b/cds/compiler/clang/defs.h index b3a054cb..4f724490 100644 --- a/cds/compiler/clang/defs.h +++ b/cds/compiler/clang/defs.h @@ -25,9 +25,6 @@ #define alignof __alignof__ -// C++11 delete definition ( function declaration = delete) -#define CDS_CXX11_DELETE_DEFINITION_SUPPORT - // C++11 inline namespace #define CDS_CXX11_INLINE_NAMESPACE_SUPPORT diff --git a/cds/compiler/cxx11_atomic.h b/cds/compiler/cxx11_atomic.h index 5508361c..726a241a 100644 --- a/cds/compiler/cxx11_atomic.h +++ b/cds/compiler/cxx11_atomic.h @@ -1276,23 +1276,8 @@ namespace cds { namespace cxx11_atomic { } }; -#ifndef CDS_CXX11_DELETE_DEFINITION_SUPPORT - class atomic_noncopyable - { - private: - atomic_noncopyable(const atomic_noncopyable&); - atomic_noncopyable& operator=(const atomic_noncopyable&); - //atomic_noncopyable& operator=(const atomic_noncopyable&) volatile; - protected: - atomic_noncopyable() = default; - }; -#endif - template struct atomic_integral -#ifndef CDS_CXX11_DELETE_DEFINITION_SUPPORT - : atomic_noncopyable -#endif { private: typename cds::details::aligned_type::type volatile m_val; @@ -1425,11 +1410,10 @@ namespace cds { namespace cxx11_atomic { : m_val(val) {} -#ifdef CDS_CXX11_DELETE_DEFINITION_SUPPORT atomic_integral(const atomic_integral&) = delete; atomic_integral& operator=(const atomic_integral&) = delete; atomic_integral& operator=(const atomic_integral&) volatile = delete; -#endif + T operator=(T val) volatile CDS_NOEXCEPT { store(val); @@ -1533,9 +1517,6 @@ namespace cds { namespace cxx11_atomic { template struct atomic -#ifndef CDS_CXX11_DELETE_DEFINITION_SUPPORT - : details::atomic_noncopyable -#endif { private: typedef details::atomic_generic_ops::type > atomic_ops; @@ -1625,11 +1606,9 @@ namespace cds { namespace cxx11_atomic { : m_data( val ) {} -#ifdef CDS_CXX11_DELETE_DEFINITION_SUPPORT atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; atomic& operator=(const atomic&) volatile = delete; -#endif T operator=(T val) volatile CDS_NOEXCEPT { @@ -1643,7 +1622,6 @@ namespace cds { namespace cxx11_atomic { } }; -#if defined(CDS_CXX11_DELETE_DEFINITION_SUPPORT) # define CDS_DECLARE_ATOMIC_INTEGRAL( _type ) \ template <> \ struct atomic<_type>: public details::atomic_integral<_type> \ @@ -1659,20 +1637,6 @@ namespace cds { namespace cxx11_atomic { _type operator=(_type val) volatile CDS_NOEXCEPT { return base_class::operator=(val); } \ _type operator=(_type val) CDS_NOEXCEPT { return base_class::operator=(val); } \ }; -#else -# define CDS_DECLARE_ATOMIC_INTEGRAL( _type ) \ - template <> \ - struct atomic<_type>: public details::atomic_integral<_type> \ - { \ - private: \ - typedef details::atomic_integral<_type> base_class ; \ - public: \ - atomic() {} \ - atomic(_type val) CDS_NOEXCEPT : base_class(val) {} \ - _type operator=(_type val) volatile CDS_NOEXCEPT { return base_class::operator=(val); } \ - _type operator=(_type val) CDS_NOEXCEPT { return base_class::operator=(val); } \ - }; -#endif CDS_DECLARE_ATOMIC_INTEGRAL(char) CDS_DECLARE_ATOMIC_INTEGRAL(signed char) @@ -1696,9 +1660,6 @@ namespace cds { namespace cxx11_atomic { template class atomic -#ifndef CDS_CXX11_DELETE_DEFINITION_SUPPORT - : details::atomic_noncopyable -#endif { private: T * volatile m_ptr; @@ -1805,11 +1766,9 @@ namespace cds { namespace cxx11_atomic { : m_ptr( val ) {} -#ifdef CDS_CXX11_DELETE_DEFINITION_SUPPORT atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; atomic& operator=(const atomic&) volatile = delete; -#endif T * operator=(T * val) volatile CDS_NOEXCEPT { @@ -2183,19 +2142,9 @@ namespace cds { namespace cxx11_atomic { atomic_flag() = default; -#ifdef CDS_CXX11_DELETE_DEFINITION_SUPPORT atomic_flag(const atomic_flag&) = delete; atomic_flag& operator=(const atomic_flag&) = delete; atomic_flag& operator=(const atomic_flag&) volatile = delete; -#elif CDS_COMPILER != CDS_COMPILER_MSVC - // MS VC generate error C2552 "non-aggregates cannot be initialized with initializer list" - // when atomic_flag initializes with ATOMIC_FLAG_INIT - private: - atomic_flag(const atomic_flag&); - atomic_flag& operator=(const atomic_flag&); - atomic_flag& operator=(const atomic_flag&) volatile; - public: -#endif platform::atomic_flag_type volatile m_Flag; } atomic_flag; diff --git a/cds/compiler/defs.h b/cds/compiler/defs.h index 5402102c..227669a7 100644 --- a/cds/compiler/defs.h +++ b/cds/compiler/defs.h @@ -10,6 +10,7 @@ - explicit conversion operator [CDS_CXX11_EXPLICIT_CONVERSION_OPERATOR_SUPPORT] - default template argument for function [CDS_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS_SUPPORT] - explicit default functions (=default) [CDS_CXX11_EXPLICITLY_DEFAULTED_FUNCTION_SUPPORT] + - =delete [CDS_CXX11_DELETE_DEFINITION_SUPPORT] */ #if CDS_COMPILER == CDS_COMPILER_MSVC diff --git a/cds/compiler/gcc/defs.h b/cds/compiler/gcc/defs.h index a142d9ba..a739d3d3 100644 --- a/cds/compiler/gcc/defs.h +++ b/cds/compiler/gcc/defs.h @@ -33,9 +33,6 @@ // C++11 inline namespace #define CDS_CXX11_INLINE_NAMESPACE_SUPPORT -// C++11 delete definition ( function declaration = delete) -#define CDS_CXX11_DELETE_DEFINITION_SUPPORT - // Lambda #define CDS_CXX11_LAMBDA_SUPPORT diff --git a/cds/compiler/icl/defs.h b/cds/compiler/icl/defs.h index 7b7c311a..8094f321 100644 --- a/cds/compiler/icl/defs.h +++ b/cds/compiler/icl/defs.h @@ -91,9 +91,6 @@ #define CDS_RVALUE_SUPPORT #define CDS_MOVE_SEMANTICS_SUPPORT -// C++11 delete definition ( function declaration = delete) -#define CDS_CXX11_DELETE_DEFINITION_SUPPORT - // C++11 inline namespace #define CDS_CXX11_INLINE_NAMESPACE_SUPPORT diff --git a/cds/compiler/vc/defs.h b/cds/compiler/vc/defs.h index 8be169f1..f359560a 100644 --- a/cds/compiler/vc/defs.h +++ b/cds/compiler/vc/defs.h @@ -94,9 +94,6 @@ #define CDS_RVALUE_SUPPORT #define CDS_MOVE_SEMANTICS_SUPPORT -// C++11 delete definition ( function declaration = delete) -#define CDS_CXX11_DELETE_DEFINITION_SUPPORT - // C++11 inline namespace //#define CDS_CXX11_INLINE_NAMESPACE_SUPPORT diff --git a/cds/details/cxx11_features.h b/cds/details/cxx11_features.h deleted file mode 100644 index f8166ea3..00000000 --- a/cds/details/cxx11_features.h +++ /dev/null @@ -1,19 +0,0 @@ -//$$CDS-header$$ - -#ifndef __CDS_DETAILS_CXX11_FEATURES_H -#define __CDS_DETAILS_CXX11_FEATURES_H -//@cond - -#ifndef __CDS_DEFS_H -# error " cannot be included directly, use instead" -#endif - -// =delete function specifier -#ifdef CDS_CXX11_DELETE_DEFINITION_SUPPORT -# define CDS_DELETE_SPECIFIER =delete -#else -# define CDS_DELETE_SPECIFIER -#endif - -//@endcond -#endif // #ifndef __CDS_DETAILS_CXX11_FEATURES_H diff --git a/cds/details/defs.h b/cds/details/defs.h index ea3c05f8..104b7ece 100644 --- a/cds/details/defs.h +++ b/cds/details/defs.h @@ -335,8 +335,6 @@ namespace cds {} // Compiler-specific defines #include -// New C++11 features -#include #define CDS_NOEXCEPT CDS_NOEXCEPT_SUPPORT #define CDS_NOEXCEPT_( expr ) CDS_NOEXCEPT_SUPPORT_( expr ) diff --git a/cds/details/marked_ptr.h b/cds/details/marked_ptr.h index 12a9b9ae..b38dec23 100644 --- a/cds/details/marked_ptr.h +++ b/cds/details/marked_ptr.h @@ -336,11 +336,9 @@ CDS_CXX11_ATOMIC_BEGIN_NAMESPACE : m_atomic( p ) {} -# ifdef CDS_CXX11_DELETE_DEFINITION_SUPPORT atomic(const atomic&) = delete; atomic& operator=(const atomic&) = delete; atomic& operator=(const atomic&) volatile = delete; -# endif marked_ptr operator=(marked_ptr val) volatile CDS_NOEXCEPT { diff --git a/doxygen/cds.doxy b/doxygen/cds.doxy index 47a235e2..fc59f713 100644 --- a/doxygen/cds.doxy +++ b/doxygen/cds.doxy @@ -1396,7 +1396,6 @@ PREDEFINED = CDS_BUILD_BITS=32 \ CDS_DOXYGEN_INVOKED \ cds_std=std \ CDS_URCU_SIGNAL_HANDLING_ENABLED \ - CDS_CXX11_DELETE_DEFINITION_SUPPORT \ CDS_CXX11_INLINE_NAMESPACE_SUPPORT \ CDS_CXX11_INLINE_NAMESPACE=inline \ CDS_CXX11_DECLTYPE_SUPPORT \ diff --git a/projects/Win/vc12/cds.vcxproj b/projects/Win/vc12/cds.vcxproj index a9bb7954..0b57040f 100644 --- a/projects/Win/vc12/cds.vcxproj +++ b/projects/Win/vc12/cds.vcxproj @@ -719,7 +719,6 @@ - diff --git a/projects/Win/vc12/cds.vcxproj.filters b/projects/Win/vc12/cds.vcxproj.filters index 2727785a..94a31d44 100644 --- a/projects/Win/vc12/cds.vcxproj.filters +++ b/projects/Win/vc12/cds.vcxproj.filters @@ -833,9 +833,6 @@ Header Files\cds\details - - Header Files\cds\details - Header Files\cds\gc -- 2.34.1