From 5e65027d46363905c4792b7e3fe0d0c9b44cc61c Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 29 Apr 2019 09:52:14 +0200 Subject: [PATCH] I did not know clang defines __GNUC__ The patch now uses `BOOST_GCC`, to avoid including clang in the conditional. --- CGAL_Core/include/CGAL/CORE/MemoryPool.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CGAL_Core/include/CGAL/CORE/MemoryPool.h b/CGAL_Core/include/CGAL/CORE/MemoryPool.h index 7d01dfae308..e7b87e5cc79 100644 --- a/CGAL_Core/include/CGAL/CORE/MemoryPool.h +++ b/CGAL_Core/include/CGAL/CORE/MemoryPool.h @@ -37,7 +37,8 @@ #include #include -#if CGAL_STATIC_THREAD_LOCAL_USE_BOOST || (defined(CGAL_HAS_THREADS)&&__GNUC__) +#include +#if CGAL_STATIC_THREAD_LOCAL_USE_BOOST || (defined(CGAL_HAS_THREADS) && BOOST_GCC) // Force the use of Boost.Thread with g++ and C++11, because of the PR66944 // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66944 // See also CGAL PR #1888 @@ -91,7 +92,7 @@ public: // Access the corresponding static global allocator. static MemoryPool& global_allocator() { -#if CGAL_STATIC_THREAD_LOCAL_USE_BOOST || (defined(CGAL_HAS_THREADS)&&__GNUC__) +#if CGAL_STATIC_THREAD_LOCAL_USE_BOOST || (defined(CGAL_HAS_THREADS) && BOOST_GCC) if(memPool_ptr.get() == NULL) {memPool_ptr.reset(new Self());} Self& memPool = * memPool_ptr.get(); #endif @@ -102,7 +103,7 @@ private: Thunk* head; // next available block in the pool std::vector blocks; -#if CGAL_STATIC_THREAD_LOCAL_USE_BOOST || (defined(CGAL_HAS_THREADS)&&__GNUC__) +#if CGAL_STATIC_THREAD_LOCAL_USE_BOOST || (defined(CGAL_HAS_THREADS) && BOOST_GCC) static boost::thread_specific_ptr memPool_ptr; #elif defined(CGAL_HAS_THREADS) // use the C++11 implementation static thread_local Self memPool; @@ -111,7 +112,7 @@ private: #endif // not CGAL_HAS_THREADS }; -#if CGAL_STATIC_THREAD_LOCAL_USE_BOOST || (defined(CGAL_HAS_THREADS)&&__GNUC__) +#if CGAL_STATIC_THREAD_LOCAL_USE_BOOST || (defined(CGAL_HAS_THREADS) && BOOST_GCC) template boost::thread_specific_ptr > MemoryPool::memPool_ptr;