From 5919bda06fa3ada0524a70a5330956e76dbe62a1 Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Tue, 2 Feb 2016 12:59:01 +0100 Subject: [PATCH] Replace BOOST_STATIC_ASSERT by CGAL_static_assertion and remove now useless CLANG work-around --- Number_types/include/CGAL/Mpzf.h | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/Number_types/include/CGAL/Mpzf.h b/Number_types/include/CGAL/Mpzf.h index 93f156caef9..55ceb4ecb61 100644 --- a/Number_types/include/CGAL/Mpzf.h +++ b/Number_types/include/CGAL/Mpzf.h @@ -75,30 +75,11 @@ #include #endif -#include +#include #include #include #include -// Standard way to deal with clang's __has_warning -// http://clang.llvm.org/docs/LanguageExtensions.html#feature-checking-macros -#ifndef __has_warning -# define __has_warning(x) 0 -#endif - -// If Clang has the warning -Wunused-local-typedef, then disable it temporarily. -#if BOOST_WORKAROUND(BOOST_VERSION, BOOST_TESTED_AT(105800)) && BOOST_CLANG && __has_warning("-Wunused-local-typedef") -# define CGAL_CLANG_PUSH_AND_IGNORE_UNUSED_LOCAL_TYPEDEF \ - _Pragma("clang diagnostic push") \ - _Pragma("clang diagnostic ignored \"-Wunused-local-typedef\"") -# define CGAL_CLANG_POP_DIAGNOSTIC _Pragma("clang diagnostic pop") -#else -# define CGAL_CLANG_PUSH_AND_IGNORE_UNUSED_LOCAL_TYPEDEF -# define CGAL_CLANG_POP_DIAGNOSTIC -#endif - -CGAL_CLANG_PUSH_AND_IGNORE_UNUSED_LOCAL_TYPEDEF - #if defined(BOOST_MSVC) # pragma warning(push) # pragma warning(disable:4146 4244 4267 4800) @@ -173,7 +154,7 @@ template struct pool2 { static bool empty() { return data() == 0; } static const int extra = 1; // TODO: handle the case where a pointer is larger than a mp_limb_t private: - BOOST_STATIC_ASSERT(sizeof(T) >= sizeof(T*)); + CGAL_static_assertion(sizeof(T) >= sizeof(T*)); static T& data () { static CGAL_MPZF_TLS T data_ = 0; return data_; @@ -188,7 +169,7 @@ template struct pool3 { static bool empty() { return data() == 0; } static const int extra = 1; // TODO: handle the case where a pointer is larger than a mp_limb_t private: - BOOST_STATIC_ASSERT(sizeof(T) >= sizeof(T*)); + CGAL_static_assertion(sizeof(T) >= sizeof(T*)); struct cleaner { T data_ = 0; ~cleaner(){ @@ -437,7 +418,7 @@ struct Mpzf { } int e1 = (int)dexp+13; // FIXME: make it more general! But not slower... - BOOST_STATIC_ASSERT(GMP_NUMB_BITS == 64); + CGAL_static_assertion(GMP_NUMB_BITS == 64); int e2 = e1 % 64; exp = e1 / 64 - 17; // 52+1023+13==17*64 ? @@ -1176,10 +1157,5 @@ namespace Eigen { # pragma warning(pop) #endif -CGAL_CLANG_POP_DIAGNOSTIC - -#undef CGAL_CLANG_PUSH_AND_IGNORE_UNUSED_LOCAL_TYPEDEF -#undef CGAL_CLANG_POP_DIAGNOSTIC - #endif // GMP_NUMB_BITS == 64 #endif // CGAL_MPZF_H