diff --git a/Installation/include/CGAL/atomic.h b/Installation/include/CGAL/atomic.h index da0a5c1c0a2..c9b6969b132 100644 --- a/Installation/include/CGAL/atomic.h +++ b/Installation/include/CGAL/atomic.h @@ -17,34 +17,21 @@ #ifdef CGAL_HAS_THREADS -# ifdef CGAL_CAN_USE_CXX11_ATOMIC # include -# define CGAL_ATOMIC_NS std -# else // not CGAL_CAN_USE_CXX11_ATOMIC -# if BOOST_VERSION >= 105300 -# include -# define CGAL_ATOMIC_NS boost -# else // BOOST_VERSION < 105300 -# define CGAL_NO_ATOMIC "Boost.Atomic was introduced in Boost-1.53". -# endif // BOOST_VERSION < 105300 -# endif // not CGAL_CAN_USE_CXX11_ATOMIC -# ifndef CGAL_NO_ATOMIC - namespace CGAL { - namespace cpp11 { - using CGAL_ATOMIC_NS ::atomic; +namespace CGAL { +namespace cpp11 { +using std::atomic; - using CGAL_ATOMIC_NS ::memory_order_relaxed; - using CGAL_ATOMIC_NS ::memory_order_consume; - using CGAL_ATOMIC_NS ::memory_order_acquire; - using CGAL_ATOMIC_NS ::memory_order_release; - using CGAL_ATOMIC_NS ::memory_order_acq_rel; - using CGAL_ATOMIC_NS ::memory_order_seq_cst; +using std::memory_order_relaxed; +using std::memory_order_consume; +using std::memory_order_acquire; +using std::memory_order_release; +using std::memory_order_acq_rel; +using std::memory_order_seq_cst; - using CGAL_ATOMIC_NS ::atomic_thread_fence; - } - } -# endif // CGAL_ATOMIC_NS +using std::atomic_thread_fence; +} } #else # define CGAL_NO_ATOMIC "No atomic because CGAL_NO_THREADS is defined." #endif // CGAL_HAS_THREADS diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index 6294f2ca523..39d1b5d4b3a 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -127,16 +127,6 @@ #include #include -// Hack: Boost<1.55 does not detect correctly the C++11 features of ICC. -// We declare by hand two features that we need (variadic templates and -// rvalue references). -#if defined(__INTEL_COMPILER) && defined(__GXX_EXPERIMENTAL_CXX0X__) -# undef BOOST_NO_VARIADIC_TEMPLATES -# undef BOOST_NO_CXX11_VARIADIC_TEMPLATES -# undef BOOST_NO_RVALUE_REFERENCES -# undef BOOST_NO_CXX11_RVALUE_REFERENCES -#endif - #include //----------------------------------------------------------------------// @@ -400,25 +390,6 @@ using std::max; # endif #endif -#if __has_feature(cxx_thread_local) || \ - ( (__GNUC__ > 0) && __cplusplus >= 201103L ) || \ - ( _MSC_VER >= 1900 ) -// see also Installation/cmake/modules/config/support/CGAL_test_cpp_version.cpp -#define CGAL_CAN_USE_CXX11_THREAD_LOCAL -#endif - -#if (__has_include() && __cplusplus >= 201103L ) | \ - ( (__GNUC__ > 0) && __cplusplus >= 201103L ) || \ - ( _MSC_VER >= 1700 ) -#define CGAL_CAN_USE_CXX11_MUTEX -#endif - -#if (__has_include() && __cplusplus >= 201103L ) || \ - ( (__GNUC__ > 0) && __cplusplus >= 201103L ) || \ - ( _MSC_VER >= 1700 ) -#define CGAL_CAN_USE_CXX11_ATOMIC -#endif - #ifndef CGAL_HAS_THREADS namespace CGAL { inline bool is_currently_single_threaded(){ return true; } } #elif __has_include() diff --git a/Installation/include/CGAL/mutex.h b/Installation/include/CGAL/mutex.h index e7c58beec27..48421e667c7 100644 --- a/Installation/include/CGAL/mutex.h +++ b/Installation/include/CGAL/mutex.h @@ -13,14 +13,8 @@ #include #ifdef CGAL_HAS_THREADS -#ifdef CGAL_CAN_USE_CXX11_MUTEX #include #define CGAL_MUTEX std::mutex #define CGAL_SCOPED_LOCK(M) std::unique_lock scoped_lock(M) -#else -#include -#define CGAL_MUTEX boost::mutex -#define CGAL_SCOPED_LOCK(M) boost::mutex::scoped_lock scoped_lock(M) -#endif #endif #endif // CGAL_MUTEX_H diff --git a/Number_types/include/CGAL/Mpzf.h b/Number_types/include/CGAL/Mpzf.h index 60034bb3896..b1b023a1058 100644 --- a/Number_types/include/CGAL/Mpzf.h +++ b/Number_types/include/CGAL/Mpzf.h @@ -112,16 +112,9 @@ #if !defined(CGAL_HAS_THREADS) #define CGAL_MPZF_THREAD_LOCAL #define CGAL_MPZF_TLS -#elif defined(CGAL_CAN_USE_CXX11_THREAD_LOCAL) +#else #define CGAL_MPZF_THREAD_LOCAL thread_local #define CGAL_MPZF_TLS thread_local -#elif defined(_MSC_VER) -#define CGAL_MPZF_THREAD_LOCAL __declspec(thread) -#define CGAL_MPZF_TLS -#else -#define CGAL_MPZF_THREAD_LOCAL __thread -#define CGAL_MPZF_TLS -// Too bad for the others #endif namespace CGAL { namespace Mpzf_impl { @@ -162,7 +155,6 @@ template struct pool2 { static T& ptr(T t) { t -= extra+1; return *reinterpret_cast(t); } }; -#if defined(CGAL_CAN_USE_CXX11_THREAD_LOCAL) template struct pool3 { static T pop() { T ret = data(); data() = ptr(data()); return ret; } static void push(T t) { ptr(t) = data(); data() = t; } @@ -185,7 +177,6 @@ template struct pool3 { } static T& ptr(T t) { t -= extra+1; return *reinterpret_cast(t); } }; -#endif // No caching template struct no_pool {