From a88a84b0f47b96c72030c2d5bf2e9a9ca0176e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 13 Aug 2021 15:46:50 +0200 Subject: [PATCH] remove some cpp0x and cpp11 config macros --- .../include/CGAL/Coercion_traits.h | 25 ++--- .../include/CGAL/Needs_parens_as_product.h | 2 - .../advanced/Configuration_variables.txt | 4 +- Installation/include/CGAL/config.h | 105 ------------------ Number_types/include/CGAL/number_type_basic.h | 4 - Number_types/test/Number_types/ioformat.cpp | 6 +- Number_types/test/Number_types/unsigned.cpp | 2 - Number_types/test/Number_types/utilities.cpp | 6 +- .../copy_n_benchmark/copy_n_benchmark.cpp | 6 - STL_Extension/include/CGAL/Iterator_range.h | 3 - STL_Extension/include/CGAL/assertions.h | 28 ----- .../include/CGAL/Surface_mesh/IO/PLY.h | 4 - 12 files changed, 11 insertions(+), 184 deletions(-) diff --git a/Algebraic_foundations/include/CGAL/Coercion_traits.h b/Algebraic_foundations/include/CGAL/Coercion_traits.h index 85f5f0cf950..2e97218dbe6 100644 --- a/Algebraic_foundations/include/CGAL/Coercion_traits.h +++ b/Algebraic_foundations/include/CGAL/Coercion_traits.h @@ -148,33 +148,26 @@ template struct Coercion_traits_for_level; CGAL_DEFINE_COERCION_TRAITS_FROM_TO(short,int) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(short,long) -#ifdef CGAL_USE_LONG_LONG - CGAL_DEFINE_COERCION_TRAITS_FROM_TO(short,long long) -#endif +CGAL_DEFINE_COERCION_TRAITS_FROM_TO(short,long long) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(short,float) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(short,double) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(short,long double) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(int,long) -#ifdef CGAL_USE_LONG_LONG - CGAL_DEFINE_COERCION_TRAITS_FROM_TO(int,long long) -#endif +CGAL_DEFINE_COERCION_TRAITS_FROM_TO(int,long long) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(int,float) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(int,double) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(int,long double) -#ifdef CGAL_USE_LONG_LONG - CGAL_DEFINE_COERCION_TRAITS_FROM_TO(long,long long) -#endif +CGAL_DEFINE_COERCION_TRAITS_FROM_TO(long,long long) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(long,float) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(long,double) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(long,long double) -#ifdef CGAL_USE_LONG_LONG - CGAL_DEFINE_COERCION_TRAITS_FROM_TO(long long,float) - CGAL_DEFINE_COERCION_TRAITS_FROM_TO(long long,double) - CGAL_DEFINE_COERCION_TRAITS_FROM_TO(long long,long double) -#endif + +CGAL_DEFINE_COERCION_TRAITS_FROM_TO(long long,float) +CGAL_DEFINE_COERCION_TRAITS_FROM_TO(long long,double) +CGAL_DEFINE_COERCION_TRAITS_FROM_TO(long long,long double) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(float,double) CGAL_DEFINE_COERCION_TRAITS_FROM_TO(float,long double) @@ -198,9 +191,7 @@ struct Coercion_traits{ CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(short) CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(int) CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(long) -#ifdef CGAL_USE_LONG_LONG - CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(long long) -#endif +CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(long long) CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(float) CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(double) CGAL_DEFINE_COERCION_TRAITS_FOR_SELF(long double) diff --git a/Algebraic_foundations/include/CGAL/Needs_parens_as_product.h b/Algebraic_foundations/include/CGAL/Needs_parens_as_product.h index 1aa82b277e3..4cc9ebcd504 100644 --- a/Algebraic_foundations/include/CGAL/Needs_parens_as_product.h +++ b/Algebraic_foundations/include/CGAL/Needs_parens_as_product.h @@ -75,11 +75,9 @@ template <> struct Needs_parens_as_product{ bool operator()(const long& x){return x < long(0);} }; -#ifdef CGAL_USE_LONG_LONG template <> struct Needs_parens_as_product{ bool operator()(const long long& x){return x < (long long)(0);} }; -#endif template <> struct Needs_parens_as_product{ bool operator()(const float& x){return x < float(0);} diff --git a/Documentation/doc/Documentation/advanced/Configuration_variables.txt b/Documentation/doc/Documentation/advanced/Configuration_variables.txt index cf7911b21e4..dbc56f57588 100644 --- a/Documentation/doc/Documentation/advanced/Configuration_variables.txt +++ b/Documentation/doc/Documentation/advanced/Configuration_variables.txt @@ -372,9 +372,7 @@ If GLPK is not automatically found, the following variables must be set: A number of boolean flags are used to workaround compiler bugs and limitations. They all start with the prefix `CGAL_CFG`. These -flags are used to work around compiler bugs and limitations. For -example, the flag `CGAL_CFG_NO_CPP0X_LONG_LONG` denotes -that the compiler does not know the type `long long`. +flags are used to work around compiler bugs and limitations. For each installation a file is defined, with the correct diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index 4400027f554..ffc307f7825 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -167,95 +167,6 @@ #define CGAL_USE_SSE2_FABS #endif -//----------------------------------------------------------------------// -// Detect features at compile-time. Some macros have only been -// introduced as of Boost 1.40. In that case, we simply say that the -// feature is not available, even if that is wrong. -// ----------------------------------------------------------------------// - -#if defined(BOOST_NO_0X_HDR_ARRAY) -#define CGAL_CFG_NO_CPP0X_ARRAY 1 -#endif -#if defined(BOOST_NO_0X_HDR_UNORDERED_SET) || \ - defined(BOOST_NO_0X_HDR_UNORDERED_MAP) || \ - (defined(_MSC_VER) && (_MSC_VER == 1800)) // std::unordered_set is very bad in MSVC2013 -#define CGAL_CFG_NO_CPP0X_UNORDERED 1 -#endif -#if defined( BOOST_NO_0X_HDR_THREAD) -#define CGAL_CFG_NO_STD_THREAD 1 -#endif -#if defined(BOOST_NO_DECLTYPE) -#define CGAL_CFG_NO_CPP0X_DECLTYPE 1 -#endif -#if defined(BOOST_NO_DELETED_FUNCTIONS) || \ - defined(BOOST_NO_DEFAULTED_FUNCTIONS) || \ - (defined(_MSC_VER) && _MSC_VER < 1900) // MSVC 2013 has only partial support -#define CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS 1 -#endif -#if defined(BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS) -#define CGAL_CFG_NO_CPP0X_DEFAULT_TEMPLATE_ARGUMENTS_FOR_FUNCTION_TEMPLATES 1 -#endif -#if defined(BOOST_NO_INITIALIZER_LISTS) -#define CGAL_CFG_NO_CPP0X_INITIALIZER_LISTS 1 -#endif -#if defined(BOOST_MSVC) -#define CGAL_CFG_NO_CPP0X_ISFINITE 1 // used in -#endif -#if defined(BOOST_NO_LONG_LONG) -#define CGAL_CFG_NO_CPP0X_LONG_LONG 1 -#endif -#if defined(BOOST_NO_LAMBDAS) -#define CGAL_CFG_NO_CPP0X_LAMBDAS 1 -#endif -#if defined(BOOST_NO_RVALUE_REFERENCES) -#define CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE 1 -#endif -#if defined(BOOST_NO_STATIC_ASSERT) -#define CGAL_CFG_NO_CPP0X_STATIC_ASSERT 1 -#endif -#if defined(BOOST_NO_0X_HDR_TUPLE) -#define CGAL_CFG_NO_CPP0X_TUPLE 1 -#endif -#if defined(BOOST_NO_VARIADIC_TEMPLATES) -#define CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES 1 -#endif -// never use TR1 -#define CGAL_CFG_NO_TR1_ARRAY 1 -// never use TR1 -#define CGAL_CFG_NO_TR1_TUPLE 1 -#if _MSC_VER==1800 -#define CGAL_CFG_NO_CPP0X_UNIFIED_INITIALIZATION_SYNTAX -#endif -#if __cplusplus < 201103L && !(_MSC_VER >= 1600) -#define CGAL_CFG_NO_CPP0X_COPY_N 1 -#define CGAL_CFG_NO_CPP0X_NEXT_PREV 1 -#endif -#if defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATIONS) \ - || defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS) -#define CGAL_CFG_NO_CPP0X_EXPLICIT_CONVERSION_OPERATORS 1 -#endif -#if defined(BOOST_NO_TEMPLATE_ALIASES) -#define CGAL_CFG_NO_CPP0X_TEMPLATE_ALIASES 1 -#endif - -// Some random list to let us write C++11 without thinking about -// each feature we are using. -#if ( __cplusplus >= 201103L || _MSVC_LANG >= 201103L ) && \ - !defined CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES && \ - !defined CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE && \ - !defined CGAL_CFG_NO_CPP0X_EXPLICIT_CONVERSION_OPERATORS && \ - !defined CGAL_CFG_NO_CPP0X_TUPLE && \ - !defined CGAL_CFG_NO_CPP0X_UNIFIED_INITIALIZATION_SYNTAX && \ - !defined CGAL_CFG_NO_CPP0X_STATIC_ASSERT && \ - !defined CGAL_CFG_NO_CPP0X_DECLTYPE && \ - !defined CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS && \ - !defined CGAL_CFG_NO_CPP0X_DEFAULT_TEMPLATE_ARGUMENTS_FOR_FUNCTION_TEMPLATES -#define CGAL_CXX11 1 -#endif -// Same for C++14. -#if __cplusplus >= 201402L || _MSVC_LANG >= 201402L -# define CGAL_CXX14 1 -#endif // Same for C++17 #if __cplusplus >= 201703L || _MSVC_LANG >= 201703L # define CGAL_CXX17 1 @@ -297,28 +208,12 @@ #define CGAL_END_NAMESPACE } #endif - -#ifndef CGAL_CFG_NO_CPP0X_LONG_LONG -# define CGAL_USE_LONG_LONG -#endif - - #ifndef CGAL_CFG_TYPENAME_BEFORE_DEFAULT_ARGUMENT_BUG # define CGAL_TYPENAME_DEFAULT_ARG typename #else # define CGAL_TYPENAME_DEFAULT_ARG #endif - -#ifdef CGAL_CFG_NO_CPP0X_DELETED_AND_DEFAULT_FUNCTIONS -# define CGAL_DELETED -# define CGAL_EXPLICITLY_DEFAULTED -#else -# define CGAL_DELETED = delete -# define CGAL_EXPLICITLY_DEFAULTED = default -#endif - - // Big endian or little endian machine. // ==================================== diff --git a/Number_types/include/CGAL/number_type_basic.h b/Number_types/include/CGAL/number_type_basic.h index 8e0cb00f85a..918e3bd521c 100644 --- a/Number_types/include/CGAL/number_type_basic.h +++ b/Number_types/include/CGAL/number_type_basic.h @@ -54,11 +54,7 @@ #include // needed by To_interval(long double), To_interval(long), To_interval(long long) #include -#ifdef CGAL_USE_LONG_LONG #include -#endif - - #ifdef CGAL_USE_GMP #ifdef CGAL_USE_GMPXX diff --git a/Number_types/test/Number_types/ioformat.cpp b/Number_types/test/Number_types/ioformat.cpp index e2d0bf7cda9..4d9a6656321 100644 --- a/Number_types/test/Number_types/ioformat.cpp +++ b/Number_types/test/Number_types/ioformat.cpp @@ -30,9 +30,7 @@ #include #endif // CGAL_USE_LEDA -#ifdef CGAL_USE_LONG_LONG -# include -#endif +#include #include #include @@ -77,10 +75,8 @@ int main() // test_it("unsigned int"); // test_it("unsigned long int"); // test_it("unsigned short int"); -#ifdef CGAL_USE_LONG_LONG test_it("long long"); // test_it("unsigned long long"); -#endif test_it("float"); test_it("double"); test_it("long double"); diff --git a/Number_types/test/Number_types/unsigned.cpp b/Number_types/test/Number_types/unsigned.cpp index b82e961cfaa..5ca8430169e 100644 --- a/Number_types/test/Number_types/unsigned.cpp +++ b/Number_types/test/Number_types/unsigned.cpp @@ -16,8 +16,6 @@ int main(){ (void)CGAL::compare(a,a); unsigned long b = 42; (void)CGAL::compare(b,b); -#ifdef CGAL_USE_LONG_LONG unsigned long long c = 42; (void)CGAL::compare(c,c); -#endif } diff --git a/Number_types/test/Number_types/utilities.cpp b/Number_types/test/Number_types/utilities.cpp index f8028bf59d6..48400c97520 100644 --- a/Number_types/test/Number_types/utilities.cpp +++ b/Number_types/test/Number_types/utilities.cpp @@ -32,9 +32,7 @@ #include #endif // CGAL_USE_LEDA -#ifdef CGAL_USE_LONG_LONG -# include -#endif +#include #include @@ -63,10 +61,8 @@ int main() // TESTIT(unsigned int, "unsigned int") // TESTIT(unsigned long int, "unsigned long int") // TESTIT(unsigned short int, "unsigned short int") -#ifdef CGAL_USE_LONG_LONG TESTIT(long long, "long long") // TESTIT(unsigned long long, "unsigned long long") -#endif TESTIT(float, "float") TESTIT(double, "double") TESTIT(long double, "long double") diff --git a/STL_Extension/benchmark/copy_n_benchmark/copy_n_benchmark.cpp b/STL_Extension/benchmark/copy_n_benchmark/copy_n_benchmark.cpp index e3a8abf0128..8c9c25999d4 100644 --- a/STL_Extension/benchmark/copy_n_benchmark/copy_n_benchmark.cpp +++ b/STL_Extension/benchmark/copy_n_benchmark/copy_n_benchmark.cpp @@ -77,11 +77,9 @@ int main(int argc, char* argv[]) { "|- \n"; float item_sec; -#ifndef CGAL_CFG_NO_CPP0X_COPY_N item_sec = test(v.begin(), n, copy_m, repeats, std_tag()); format_output("stdlib", "vector", "int*", n, item_sec); std::cout << "|- \n"; -#endif item_sec = test(v.begin(), n, copy_m, repeats, cgal_tag()); format_output("CGAL", "vector", "int*", n, item_sec); @@ -93,11 +91,9 @@ int main(int argc, char* argv[]) { list l(n); -#ifndef CGAL_CFG_NO_CPP0X_COPY_N item_sec = test(l.begin(), n, copy_m, repeats, std_tag()); format_output("stdlib", "list", "int*", n, item_sec); std::cout << "|- \n"; -#endif item_sec = test(l.begin(), n, copy_m, repeats, cgal_tag()); format_output("CGAL", "list", "int*", n, item_sec); @@ -108,11 +104,9 @@ int main(int argc, char* argv[]) { vector2 v2(n); copy_mem2 copy_m2 = new non_trivial_cctor[n]; -#ifndef CGAL_CFG_NO_CPP0X_COPY_N item_sec = test(v2.begin(), n, copy_m2, repeats, std_tag()); format_output("stdlib", "vector", "non_trivial_cctor*", n, item_sec); std::cout << "|- \n"; -#endif item_sec = test(v2.begin(), n, copy_m2, repeats, cgal_tag()); format_output("CGAL", "vector", "non_trivial_cctor*", n, item_sec); diff --git a/STL_Extension/include/CGAL/Iterator_range.h b/STL_Extension/include/CGAL/Iterator_range.h index e998fcf8cdc..e1d41818d5a 100644 --- a/STL_Extension/include/CGAL/Iterator_range.h +++ b/STL_Extension/include/CGAL/Iterator_range.h @@ -68,7 +68,6 @@ namespace CGAL { { return begin()==end(); } -#ifndef CGAL_CFG_NO_CPP0X_TUPLE operator std::tuple() { @@ -79,8 +78,6 @@ namespace CGAL { { return std::tuple{this->first, this->second}; } -#endif - }; template diff --git a/STL_Extension/include/CGAL/assertions.h b/STL_Extension/include/CGAL/assertions.h index f3de2c1e8b2..e9ecb9d52ef 100644 --- a/STL_Extension/include/CGAL/assertions.h +++ b/STL_Extension/include/CGAL/assertions.h @@ -44,10 +44,6 @@ # define CGAL_NO_WARNINGS #endif -#ifdef CGAL_CFG_NO_CPP0X_STATIC_ASSERT -#include -#endif - namespace CGAL { // function declarations @@ -110,8 +106,6 @@ inline bool possibly(Uncertain c); # define CGAL_assume_code(CODE) CGAL_assertion_code(CODE) #endif // no CGAL_NO_ASSERTIONS -#ifndef CGAL_CFG_NO_CPP0X_STATIC_ASSERT - # if defined(CGAL_NO_ASSERTIONS) # define CGAL_static_assertion(EX) \ @@ -130,28 +124,6 @@ inline bool possibly(Uncertain c); # endif // no CGAL_NO_ASSERTIONS -#else // if CGAL_CFG_NO_CPP0X_STATIC_ASSERT is true - -# if defined(CGAL_NO_ASSERTIONS) - -# define CGAL_static_assertion(EX) \ - BOOST_STATIC_ASSERT(true) CGAL_UNUSED - -# define CGAL_static_assertion_msg(EX,MSG) \ - BOOST_STATIC_ASSERT(true) CGAL_UNUSED - -# else // no CGAL_NO_ASSERTIONS - -# define CGAL_static_assertion(EX) \ - BOOST_STATIC_ASSERT(EX) CGAL_UNUSED - -# define CGAL_static_assertion_msg(EX,MSG) \ - BOOST_STATIC_ASSERT(EX) CGAL_UNUSED - -# endif // no CGAL_NO_ASSERTIONS - -#endif // if CGAL_CFG_NO_CPP0X_STATIC_ASSERT is true - #if defined(CGAL_NO_ASSERTIONS) || !defined(CGAL_CHECK_EXACTNESS) # define CGAL_exactness_assertion(EX) (static_cast(0)) # define CGAL_exactness_assertion_msg(EX,MSG) (static_cast(0)) diff --git a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h index 26fc352c391..a99b5558db6 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/IO/PLY.h @@ -21,8 +21,6 @@ #include #include -#if !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) && !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) - #include #ifdef DOXYGEN_RUNNING @@ -1158,6 +1156,4 @@ CGAL_DEPRECATED bool write_ply(std::ostream& os, const Surface_mesh

& sm) } // namespace CGAL -#endif // !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) && !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) - #endif // CGAL_SURFACE_MESH_IO_PLY_H