Commit Graph

73 Commits

Author SHA1 Message Date
Sébastien Loriot bbc4d08ee0 Merge remote-tracking branch 'cgal/master' into HEAD 2023-06-15 10:47:07 +02:00
Sébastien Loriot c8a88b9014 remove CGAL_static_assertion* 2023-06-15 10:42:10 +02:00
Andreas Fabri d076b250ee CGAL: Enable user to provide set_use_assertions() 2023-05-12 11:01:11 +01:00
albert-github 3674c937f7 spelling corrections
Some spelling corrections (Directories starting with `M`-` N`),
some backward work
some forward work
2022-11-15 15:21:01 +01:00
Andreas Fabri def163afc2
Update STL_Extension/include/CGAL/assertions.h
Co-authored-by: Sebastien Loriot <sloriot.ml@gmail.com>
2022-10-07 14:25:18 +02:00
Andreas Fabri fa3f8a5872 Do the test if we want to assert at runtime only when CGAL_ENABLE_DISABLE_ASSERTIONS_AT_RUNTIME is defined 2022-10-07 11:21:02 +01:00
Andreas Fabri 9b357c6aff Reintroduce the runtime switch to enable/disable assrtions 2022-10-04 10:35:05 +01:00
Sébastien Loriot 2d9280ec96 do not modify CGAL_assume 2021-10-27 16:09:32 +02:00
Sébastien Loriot 85c00352c3 separate macros and macro function 2021-10-27 16:01:19 +02:00
Sébastien Loriot 604d2fd1ff direct definition
the extra if was generating fallthru warnings
2021-10-27 15:19:05 +02:00
Sébastien Loriot d370326ec1 add CGAL_unreachable as requested by @lrineau and @mglisse 2021-10-27 14:45:10 +02:00
Sébastien Loriot c04f88368f static_assert is not affected by NDEBUG 2021-09-08 10:38:21 +02:00
Sébastien Loriot a88a84b0f4 remove some cpp0x and cpp11 config macros 2021-08-13 15:46:50 +02:00
Giles Bathgate 5ecd85248a Fix capitalisation of macro name. 2021-04-28 21:03:45 +01:00
Giles Bathgate 254f1bf6b9 Add conditional noexcept to Handle/Handle_for 2021-04-28 21:03:03 +01:00
Giles Bathgate 0ef8127c71 The CGAL_NOEXCEPT macro is no longer needed 2021-04-28 21:03:00 +01:00
Giles Bathgate 78bbe15325 Add a destructor assertion catch macro 2020-11-28 14:17:59 +00:00
Sébastien Loriot 822bc55640 extra run of the script to remove tabs and trailing whitespaces 2020-03-27 08:28:48 +01:00
Laurent Rineau fbf790637e Patch for MSVC and clang 2020-03-09 16:32:26 +01:00
Laurent Rineau 0dfd416395 Use [[noreturn]] directly 2020-03-06 09:26:54 +01:00
Sébastien Loriot 52164b1fba First pass on removing license notice in header for LGPL files 2019-10-19 15:40:30 +02:00
Sébastien Loriot 7356421d80 introduce Commercial license SPDX tag 2019-10-19 12:15:19 +02:00
Sébastien Loriot 9bd9c68b83 update LGPL[23]+ and GPL[23]+ SPDX tags
ack -l --no-svg "SPDX-License-Identifier: GPL-3.0\+" | xargs sed -i "s/SPDX-License-Identifier: GPL-3.0+/SPDX-License-Identifier: GPL-3.0-or-later/"
ack -l --no-svg "SPDX-License-Identifier: LGPL-3.0\+" | xargs sed -i "s/SPDX-License-Identifier: LGPL-3.0+/SPDX-License-Identifier: LGPL-3.0-or-later/"
ack -l --no-svg "SPDX-License-Identifier: GPL-2.0\+" | xargs sed -i "s/SPDX-License-Identifier: GPL-2.0+/SPDX-License-Identifier: GPL-2.0-or-later/"
ack -l --no-svg "SPDX-License-Identifier: LGPL-2.0\+" | xargs sed -i "s/SPDX-License-Identifier: LGPL-2.0+/SPDX-License-Identifier: LGPL-2.0-or-later/"
2019-10-18 21:57:54 +02:00
Andreas Fabri 00ebc78c1d fix #if in assertions.h 2018-04-17 14:45:37 +01:00
Andreas Fabri bc53cd2392 fix #if in assertions.h 2018-04-17 14:19:05 +01:00
Andreas Fabri 7cbffac35b Deal with deprecated functions allocator<T>::construct/destroy 2018-04-17 13:35:04 +01:00
Laurent Rineau 758688beba Merge pull request #2837 from afabri/CGAL-no_return-GF
Define CGAL_NORETURN also for VC++
2018-02-23 17:34:41 +01:00
Andreas Fabri bcbbf35dad Define CGAL_NORETURN also for VC++ and move the macro before the functions 2018-02-14 14:51:40 +00:00
Laurent Rineau 43c88bf260 Merge pull request #2817 from lrineau/STL_Extensions-cpp17_uncaught_exceptions-GF
Use std::uncaught_exceptions() when available
2018-02-14 15:33:40 +01:00
Laurent Rineau ce09744a4a Use std::uncaught_exceptions() when available
That should fix the following warning.
```
[ 50%] Building CXX object CMakeFiles/dynamic_properties_test.dir/dynamic_properties_test.cpp.o
/usr/local/bin/c++   -DCGAL_TEST_SUITE=1 -DCGAL_USE_GMP -DCGAL_USE_MPFR -I/home/cgal_tester/build/src/cmake/platforms/Ubuntu-latest-GCC6-CXX1z/test/Property_map/../../include -isystem /usr/include/x86_64-linux-gnu -I/home/cgal_tester/build/src/cmake/platforms/Ubuntu-latest-GCC6-CXX1z/test/Property_map -I/home/cgal_tester/build/src/cmake/platforms/Ubuntu-latest-GCC6-CXX1z/include -I/mnt/testsuite/include  -DDONT_USE_BOOST_PROGRAM_OPTIONS -Wall -Wextra -std=c++1z -frounding-math   -Wall -frounding-math -o CMakeFiles/dynamic_properties_test.dir/dynamic_properties_test.cpp.o -c /home/cgal_tester/build/src/cmake/platforms/Ubuntu-latest-GCC6-CXX1z/test/Property_map/dynamic_properties_test.cpp
In file included from /mnt/testsuite/include/CGAL/basic.h:43,
                 from /mnt/testsuite/include/CGAL/Cartesian/Cartesian_base.h:29,
                 from /mnt/testsuite/include/CGAL/Simple_cartesian.h:29,
                 from /mnt/testsuite/include/CGAL/Exact_predicates_inexact_constructions_kernel.h:29,
                 from /home/cgal_tester/build/src/cmake/platforms/Ubuntu-latest-GCC6-CXX1z/test/Property_map/dynamic_properties_test.cpp:2:
/mnt/testsuite/include/CGAL/Polyhedron_incremental_builder_3.h: In destructor 'CGAL::Polyhedron_incremental_builder_3<HalfedgeDS_>::~Polyhedron_incremental_builder_3()':
/mnt/testsuite/include/CGAL/assertions.h:104:30: warning: 'bool std::uncaught_exception()' is deprecated [-Wdeprecated-declarations]
    (CGAL::possibly(EX)||std::uncaught_exception()?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__))
                              ^~~~~~~~~~~~~~~~~~
/mnt/testsuite/include/CGAL/Polyhedron_incremental_builder_3.h:204:9: note: in expansion of macro 'CGAL_destructor_assertion'
         CGAL_destructor_assertion( check_protocoll == 0);
         ^~~~~~~~~~~~~~~~~~~~~~~~~
```
https://cgal.geometryfactory.com/CGAL/testsuite/CGAL-4.12-Ic-168/Property_map/TestReport_lrineau_Ubuntu-latest-GCC6-CXX1z.gz

Fix #2806.
2018-02-09 18:46:16 +01:00
Sébastien Loriot 0698f79aff add SPDX identifier for files under the LGPL-3+ license 2017-11-12 10:17:50 +01:00
Laurent Rineau 8fe3f26c6f Always include <boost/static_assert.hpp>
If C++11 `static_assert` cannot be used, `BOOST_STATIC_ASSERT` is used
instead *even with `CGAL_NO_ASSERTIONS`*.
2016-09-16 15:25:23 +02:00
Laurent Rineau be8b97eaeb Fix CGAL_NO_ASSERTIONS
- `CGAL_NO_ASSERTIONS` was used *before* it was potentially modified by
the `NDEBUG` macro.

- I have also added a macro `CGAL_DEBUG` that allows to disable `assert`
  but not CGAL assertions, using:

      -DNDEBUG -DCGAL_DEBUG
2016-08-29 19:25:50 +02:00
Giles Bathgate 9645135ff5 Introduces a CGAL_destructor_assertion macro.
This macro can safely be called from a destructor, even when
the stack is currently unwinding, and thus prevents uncatchable
exceptions.
2015-11-23 16:47:59 +00:00
Clement Jamin ed3113f89d Code clean-up 2015-03-16 17:01:49 +01:00
Clement Jamin 8bd1fd196c Revert "Temporary CGAL_EXPORT redef"
This reverts commit 5aaa7e8f4f.
It was already there!
2015-03-16 15:13:02 +01:00
Clement Jamin 5aaa7e8f4f Temporary CGAL_EXPORT redef 2015-03-16 14:51:32 +01:00
Clement Jamin e18e59a72a Header-only for package Kinetic_data_structures 2014-12-02 20:41:19 +01:00
Guillaume Damiand 1182319f5d Redo all the modifs to remove all the cpp files from cgal.
First step where all the XXX.cpp are copied into XXX_impl.h files.
The macro CGAL_HEADER_ONLY allows to know if impl files need to be
included or not into header files; and allow to decide if functions are
in impl files are inline or not.

Next step: process with static variables for the header only version.
2014-10-30 16:05:22 +01:00
Laurent Rineau 3f894697bc New macros CGAL_assume(EX) and CGAL_assume_code(CODE)
CGAL_assume(EX) is like CGAL_assertion, but is not disabled in release
mode. In debug mode, it is similar to CGAL_assertion(). In release mode, it
uses builtins of the compilateur, like the MSVC __assume or the g++/clang
__builtin_unreachable to give an hint to the compiler that some situation
in the code cannot happen.
2013-02-20 18:34:15 +01:00
Laurent Rineau 29c05b900b Mark BOOST_STATIC_ASSERT with 'CGAL_UNUSED'
In order to fix such a warning from g++-4.8:
  warning: typedef ‘boost_static_assert_typedef_241’ locally defined but
  not used [-Wunused-local-typedefs]
then:
  - create one macro CGAL_UNUSED that is "__attribute__ ((__unused__))"
    with g++ or empty otherwise,
  - use it after BOOST_STATIC_ASSERT in the definition of
    CGAL_static_assertion.
2013-02-07 18:15:23 +01:00
Laurent Rineau 7bc300794d Fix last errors in headers of CGAL foundations
All were missing #include.
2012-10-08 09:03:50 +00:00
Laurent Rineau 0b760d0fbb Remove warnings about static assertions 2012-01-23 12:29:17 +00:00
Laurent Rineau 1efe6ff9c4 merge from next, again 2011-10-13 10:25:40 +00:00
Laurent Rineau b41acfcc5e Revert those two commits:
| ------------------------------------------------------------------------
  | r65838 | afabri | 2011-10-12 13:01:14 +0200 (Wed, 12 Oct 2011) | 5 lines
  | Changed paths:
  |    M /branches/next/STL_Extension/include/CGAL/assertions.h
  | 
  | When CGAL_NO_ASSERTIONS, fix CGAL_static_assertion 
  | 
  | CGAL_static_assertion cannot be "static_cast<void>(0)" because that
  | macro can also be used in a class or namespace scope.
  | 
  | ------------------------------------------------------------------------
  | r65833 | lrineau | 2011-10-11 23:43:39 +0200 (Tue, 11 Oct 2011) | 6 lines
  | Changed paths:
  |    M /branches/next/STL_Extension/include/CGAL/assertions.h
  | 
  | Avoid a warning with -ansi -pedantic when CGAL_NO_ASSERTIONS
  | 
  | When CGAL_NO_ASSERTIONS is defined (when NDEBUG is defined, for example), 
  | "CGAL_static_assertion(true);" must not be expanded to ";", to avoid a
  | pedantic warning "extra ;".
  | 
  | ------------------------------------------------------------------------

That was just a very wrong way to fix a pedantic warning: the new
implementations were buggy.
2011-10-13 10:24:14 +00:00
Laurent Rineau 5946c69608 merge from next 2011-10-12 13:52:06 +00:00
Andreas Fabri eba24795fa When CGAL_NO_ASSERTIONS, fix CGAL_static_assertion
CGAL_static_assertion cannot be "static_cast<void>(0)" because that
macro can also be used in a class or namespace scope.
2011-10-12 11:01:14 +00:00
Laurent Rineau 44be6552ef Avoid a warning with -ansi -pedantic when CGAL_NO_ASSERTIONS
When CGAL_NO_ASSERTIONS is defined (when NDEBUG is defined, for example), 
"CGAL_static_assertion(true);" must not be expanded to ";", to avoid a
pedantic warning "extra ;".
2011-10-11 21:43:39 +00:00
Sébastien Loriot 91a5327fa8 change LGPLv2 -> LGPLv3 2011-10-10 13:48:25 +00:00
Andreas Fabri cbfe32ce37 Add declspecs for Visual C++ so that we can build dlls 2011-10-05 19:12:23 +00:00