From f0ac2367139bc8190816754471e382e429d064f1 Mon Sep 17 00:00:00 2001 From: Giles Bathgate Date: Fri, 8 Jan 2016 20:31:59 +0000 Subject: [PATCH] Introduces a GCAL_NO_ASSERTIONS_BOOL macro This macro is always defined. Its value will be true when assertions are defined and false when assertions are not defined. This macro can then be used in place of a true false constant, such as is needed for CGAL_NOEXCEPT. --- .../include/CGAL/Combinatorial_map_iterators_base.h | 2 +- Installation/include/CGAL/config.h | 6 ++++++ Kinetic_data_structures/include/CGAL/Kinetic/Ref_counted.h | 2 +- Polyhedron/include/CGAL/Polyhedron_incremental_builder_3.h | 2 +- Surface_mesher/include/CGAL/builder.h | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h b/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h index ec28857df89..2c9ff3b79aa 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_iterators_base.h @@ -410,7 +410,7 @@ namespace CGAL { {} /// Destructor. - ~CMap_non_basic_iterator() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS) + ~CMap_non_basic_iterator() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) { CGAL_destructor_assertion( this->mmark_number!=Map::INVALID_MARK ); if (this->mmap->get_number_of_times_mark_reserved diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index 43a1f7a5ad2..3b854e05b80 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -470,4 +470,10 @@ typedef const void * Nullptr_t; // Anticipate C++0x's std::nullptr_t #define CGAL_NOEXCEPT(x) #endif +#ifndef CGAL_NO_ASSERTIONS +# define CGAL_NO_ASSERTIONS_BOOL false +#else +# define CGAL_NO_ASSERTIONS_BOOL true +#endif + #endif // CGAL_CONFIG_H diff --git a/Kinetic_data_structures/include/CGAL/Kinetic/Ref_counted.h b/Kinetic_data_structures/include/CGAL/Kinetic/Ref_counted.h index c63639c5419..276333d3b28 100644 --- a/Kinetic_data_structures/include/CGAL/Kinetic/Ref_counted.h +++ b/Kinetic_data_structures/include/CGAL/Kinetic/Ref_counted.h @@ -51,7 +51,7 @@ public: return reference_count_ != 0; } - virtual ~Ref_counted_base() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS) + virtual ~Ref_counted_base() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) { CGAL_destructor_assertion(reference_count_==0); } diff --git a/Polyhedron/include/CGAL/Polyhedron_incremental_builder_3.h b/Polyhedron/include/CGAL/Polyhedron_incremental_builder_3.h index 409a273fbbc..faf009a6eae 100644 --- a/Polyhedron/include/CGAL/Polyhedron_incremental_builder_3.h +++ b/Polyhedron/include/CGAL/Polyhedron_incremental_builder_3.h @@ -195,7 +195,7 @@ public: CGAL_assertion_code(check_protocoll = 0;) } - ~Polyhedron_incremental_builder_3() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS) + ~Polyhedron_incremental_builder_3() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) { CGAL_destructor_assertion( check_protocoll == 0); } diff --git a/Surface_mesher/include/CGAL/builder.h b/Surface_mesher/include/CGAL/builder.h index 1beef844cae..f0870606358 100644 --- a/Surface_mesher/include/CGAL/builder.h +++ b/Surface_mesher/include/CGAL/builder.h @@ -195,7 +195,7 @@ public: CGAL_assertion_code(check_protocoll = 0;) } - ~Enriched_polyhedron_incremental_builder_3() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS) + ~Enriched_polyhedron_incremental_builder_3() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) { CGAL_destructor_assertion( check_protocoll == 0); }