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.
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.
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.
| ------------------------------------------------------------------------
| 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.
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 ;".
Freie Universitaet Berlin (Germany), Martin-Luther-University Halle-Wittenberg
(Germany) and RISC Linz (Austria) as they transfer the copyright to other
sites.
by namespace CGAL { and } //namespace CGAL. in all .h and .cpp files
in a directory.
Apply it to all packages in the trunk
Remove macro definition from the config.h file.
changing functions to a separate header, not included by default
(<CGAL/assertions_behaviour.h>). The motivation is to hide the enum
values with risky names (ABORT, EXIT, CONTINUE) to a header file which
is most probably not used by any user (or very few).
(breaks backward compatibility for an expected very few, for the sake
of erasing random surprises for "many" ?)
Things like "CGAL_assertion(denominator != 0)" produced assertion failures for no gain.
So now, the assertion is triggered only if the condition is certain, using CGAL::certainly().
That is, change the following in all assertion files :
((EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__))
to :
(CGAL::certainly(EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__))
* CGAL_error to CGAL_error_msg
* introduced a macro CGAL_error()
* added some words about CGAL_error to the developers manual
* renamed most of assert(x) into CGAL_assertion(x)
* renamed exit(x) with x != 0 , CGAL_assertion(false) and assert(false) into CGAL_error
* CORE left untouched, OpenNL changed