Re-implement BT_ASSERT without using the assert macro
BT_ASSERT is currently defined using the assert macro. If NDEBUG is
inadvertently defined, BT_ASSERT has no effect. This is quite
unfortunate, since a user who has defined BABELTRACE_DEBUG_MODE to 1
probably wants BT_ASSERT to be effective.
This problem was encountered while building the Python bindings, where
the distutils native code builder is passing -DNDEBUG to the compiler.
The BT_ASSERT macro usages in these files were found to be ineffective.
This patch avoids this situation by making BT_ASSERT call our own
handler if the assertion fails. This also has the advantage of letting
us personalize the behavior on assertion failures. The presence of the
so-called Lenny Face having absolutely no regards for the furniture is a
good example of this (and was a requirement coming from Philippe
Proulx).
Removing the inclusion of assert.h in assert-internal.h revealed a few
spots that use the assert macro without including assert.h, so they were
adjusted accordingly.
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
This page took 0.027188 seconds and 4 git commands to generate.