diff --git a/BGL/test/BGL/test_suffix_Polyhedron_3.cpp b/BGL/test/BGL/test_suffix_Polyhedron_3.cpp index b48c3ad700f..3e26ddc8dec 100644 --- a/BGL/test/BGL/test_suffix_Polyhedron_3.cpp +++ b/BGL/test/BGL/test_suffix_Polyhedron_3.cpp @@ -1,3 +1,5 @@ +#include + bool test( string off_file ) { bool rContinue = true ; diff --git a/Installation/CHANGES b/Installation/CHANGES index ea66356d566..05e6e75fd85 100644 --- a/Installation/CHANGES +++ b/Installation/CHANGES @@ -16,7 +16,9 @@ The following functionality has been added or changed: helping users discover if they rely on code that may be removed in subsequent releases. - - It is not possible anymore to set the CONTINUE mode for assertion failures. + - Assertion behaviour: + It is not possible anymore to set the CONTINUE mode for assertion failures. + Functions that allow to change the assertion behaviour are now declared in . 2- Installation diff --git a/Manual/doc_tex/Preliminaries/checks.tex b/Manual/doc_tex/Preliminaries/checks.tex index 2a8cbd5f109..d6ae85fef87 100644 --- a/Manual/doc_tex/Preliminaries/checks.tex +++ b/Manual/doc_tex/Preliminaries/checks.tex @@ -95,7 +95,7 @@ violated, an exception is thrown, and if nothing is done to catch it, the program will abort. This behavior can be changed by means of the following function. -\ccInclude{CGAL/assertions.h} +\ccInclude{CGAL/assertions_behaviour.h} \ccGlueBegin \ccGlobalFunction{Failure_behaviour diff --git a/Mesh_2/demo/Mesh_2/mesh_2_demo.cpp b/Mesh_2/demo/Mesh_2/mesh_2_demo.cpp index 95b21f301db..7649c8766e7 100644 --- a/Mesh_2/demo/Mesh_2/mesh_2_demo.cpp +++ b/Mesh_2/demo/Mesh_2/mesh_2_demo.cpp @@ -1508,6 +1508,7 @@ const QString MyWindow::my_filters = #include +#include #include CGAL::Failure_function my_previous_failure_function; diff --git a/STL_Extension/include/CGAL/assertions.h b/STL_Extension/include/CGAL/assertions.h index e85445b2b36..2db31ff967f 100644 --- a/STL_Extension/include/CGAL/assertions.h +++ b/STL_Extension/include/CGAL/assertions.h @@ -26,14 +26,10 @@ #ifndef CGAL_ASSERTIONS_H #define CGAL_ASSERTIONS_H +// #include // for backward compatibility + CGAL_BEGIN_NAMESPACE -// types -// ===== - -enum Failure_behaviour { ABORT, EXIT, EXIT_WITH_SUCCESS, CONTINUE, - THROW_EXCEPTION }; - // function declarations // ===================== // failure functions @@ -278,29 +274,6 @@ inline bool possibly(Uncertain c); #define CGAL_error_msg(MSG) ::CGAL::assertion_fail( "", __FILE__, __LINE__, MSG ) #define CGAL_error() ::CGAL::assertion_fail( "", __FILE__, __LINE__ ) -// failure handler declarations -// ========================== -// failure handler -// --------------- -typedef - void - (*Failure_function)( - const char*, const char*, const char*, int, const char*); - -Failure_function -set_error_handler( Failure_function handler); - -Failure_function -set_warning_handler( Failure_function handler); - -// failure behaviour handler -// ------------------------- -Failure_behaviour -set_error_behaviour(Failure_behaviour eb); - -Failure_behaviour -set_warning_behaviour(Failure_behaviour eb); - CGAL_END_NAMESPACE // This comes last as it is dependant on the macros to be defined. diff --git a/STL_Extension/include/CGAL/assertions_behaviour.h b/STL_Extension/include/CGAL/assertions_behaviour.h new file mode 100644 index 00000000000..31653fe9520 --- /dev/null +++ b/STL_Extension/include/CGAL/assertions_behaviour.h @@ -0,0 +1,59 @@ +// Copyright (c) 1999 Utrecht University (The Netherlands), +// ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany), +// INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg +// (Germany), Max-Planck-Institute Saarbruecken (Germany), RISC Linz (Austria), +// and Tel-Aviv University (Israel). All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// +// +// Author(s) : Geert-Jan Giezeman and Sven Schoenherr + +#include + +#ifndef CGAL_ASSERTIONS_BEHAVIOUR_H +#define CGAL_ASSERTIONS_BEHAVIOUR_H + +CGAL_BEGIN_NAMESPACE + +enum Failure_behaviour { ABORT, EXIT, EXIT_WITH_SUCCESS, CONTINUE, + THROW_EXCEPTION }; + +// failure handler declarations +// ========================== +// failure handler +// --------------- +typedef + void + (*Failure_function)( + const char*, const char*, const char*, int, const char*); + +Failure_function +set_error_handler( Failure_function handler); + +Failure_function +set_warning_handler( Failure_function handler); + +// failure behaviour handler +// ------------------------- +Failure_behaviour +set_error_behaviour(Failure_behaviour eb); + +Failure_behaviour +set_warning_behaviour(Failure_behaviour eb); + +CGAL_END_NAMESPACE + +#endif // CGAL_ASSERTIONS_BEHAVIOUR_H diff --git a/STL_Extension/src/CGAL/assertions.cpp b/STL_Extension/src/CGAL/assertions.cpp index 5b10ec7576f..ac1e64d49f9 100644 --- a/STL_Extension/src/CGAL/assertions.cpp +++ b/STL_Extension/src/CGAL/assertions.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include diff --git a/Straight_skeleton_2/demo/Straight_skeleton_2/straight_skeleton_2.cpp b/Straight_skeleton_2/demo/Straight_skeleton_2/straight_skeleton_2.cpp index 1f3a6489a65..540cf37ddf3 100644 --- a/Straight_skeleton_2/demo/Straight_skeleton_2/straight_skeleton_2.cpp +++ b/Straight_skeleton_2/demo/Straight_skeleton_2/straight_skeleton_2.cpp @@ -53,6 +53,8 @@ #include #include +#include + #include "ss_types.h" #include "straight_skeleton_2_toolbar.h" #include "straight_skeleton_2_toolbar_layers.h" diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp index 5a7adfcc83c..02b4ad0decc 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp @@ -28,6 +28,8 @@ #include +#include + bool sTestInner = true ; bool sTestOuter = true ; bool sTestOffsets = true ; diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/aux_edge_collapse_test_Polyhedron_3.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/aux_edge_collapse_test_Polyhedron_3.cpp index caba3f1eb77..d6c3481c014 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/aux_edge_collapse_test_Polyhedron_3.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/aux_edge_collapse_test_Polyhedron_3.cpp @@ -49,6 +49,8 @@ #include #include +#include + using namespace std ; using namespace boost ; using namespace CGAL ;