remove some cpp0x and cpp11 config macros

This commit is contained in:
Sébastien Loriot 2021-08-13 15:46:50 +02:00
parent 00fd00fafc
commit a88a84b0f4
12 changed files with 11 additions and 184 deletions

View File

@ -148,33 +148,26 @@ template<class A , class B, int > 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<A,A>{
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)

View File

@ -75,11 +75,9 @@ template <> struct Needs_parens_as_product<long>{
bool operator()(const long& x){return x < long(0);}
};
#ifdef CGAL_USE_LONG_LONG
template <> struct Needs_parens_as_product<long long>{
bool operator()(const long long& x){return x < (long long)(0);}
};
#endif
template <> struct Needs_parens_as_product<float>{
bool operator()(const float& x){return x < float(0);}

View File

@ -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 <TT><CGAL/compiler_config.h></TT>
is defined, with the correct

View File

@ -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 <CGAL/CORE/Filter.h>
#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.
// ====================================

View File

@ -54,11 +54,7 @@
#include <CGAL/Interval_nt.h> // needed by To_interval(long double), To_interval(long), To_interval(long long)
#include <CGAL/int.h>
#ifdef CGAL_USE_LONG_LONG
#include <CGAL/long_long.h>
#endif
#ifdef CGAL_USE_GMP
#ifdef CGAL_USE_GMPXX

View File

@ -30,9 +30,7 @@
#include <CGAL/leda_real.h>
#endif // CGAL_USE_LEDA
#ifdef CGAL_USE_LONG_LONG
# include <CGAL/long_long.h>
#endif
#include <CGAL/long_long.h>
#include <CGAL/Number_type_checker.h>
#include <cassert>
@ -77,10 +75,8 @@ int main()
// test_it<unsigned int>("unsigned int");
// test_it<unsigned long int>("unsigned long int");
// test_it<unsigned short int>("unsigned short int");
#ifdef CGAL_USE_LONG_LONG
test_it<long long>("long long");
// test_it<unsigned long long>("unsigned long long");
#endif
test_it<float>("float");
test_it<double>("double");
test_it<long double>("long double");

View File

@ -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
}

View File

@ -32,9 +32,7 @@
#include <CGAL/leda_real.h>
#endif // CGAL_USE_LEDA
#ifdef CGAL_USE_LONG_LONG
# include <CGAL/long_long.h>
#endif
#include <CGAL/long_long.h>
#include <CGAL/Number_type_checker.h>
@ -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")

View File

@ -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>", "int*", n, item_sec);
std::cout << "|- \n";
#endif
item_sec = test(v.begin(), n, copy_m, repeats, cgal_tag());
format_output("CGAL", "vector<int>", "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>", "int*", n, item_sec);
std::cout << "|- \n";
#endif
item_sec = test(l.begin(), n, copy_m, repeats, cgal_tag());
format_output("CGAL", "list<int>", "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>", "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>", "non_trivial_cctor*", n, item_sec);

View File

@ -68,7 +68,6 @@ namespace CGAL {
{
return begin()==end();
}
#ifndef CGAL_CFG_NO_CPP0X_TUPLE
operator std::tuple<I&, I&>()
{
@ -79,8 +78,6 @@ namespace CGAL {
{
return std::tuple<const I&, const I&>{this->first, this->second};
}
#endif
};
template <typename T>

View File

@ -44,10 +44,6 @@
# define CGAL_NO_WARNINGS
#endif
#ifdef CGAL_CFG_NO_CPP0X_STATIC_ASSERT
#include <boost/static_assert.hpp>
#endif
namespace CGAL {
// function declarations
@ -110,8 +106,6 @@ inline bool possibly(Uncertain<bool> 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<bool> 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<void>(0))
# define CGAL_exactness_assertion_msg(EX,MSG) (static_cast<void>(0))

View File

@ -21,8 +21,6 @@
#include <CGAL/boost/graph/Named_function_parameters.h>
#include <CGAL/boost/graph/named_params_helper.h>
#if !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE) && !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES)
#include <CGAL/IO/PLY.h>
#ifdef DOXYGEN_RUNNING
@ -1158,6 +1156,4 @@ CGAL_DEPRECATED bool write_ply(std::ostream& os, const Surface_mesh<P>& 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