Unconditionally declare boost::assertion_failed, boost::assertion_failed_msg

This commit is contained in:
Peter Dimov
2026-06-27 15:37:31 +03:00
parent 20925f677e
commit 2008e4d228
+19 -12
View File
@@ -25,6 +25,25 @@
// boostinspect:naassert_macro
//
//
// Declarations of boost::assertion_failed, boost::assertion_failed_msg
//
namespace boost
{
#if defined(BOOST_ASSERT_HANDLER_IS_NORETURN)
BOOST_NORETURN
#endif
void assertion_failed( char const* expr, char const* function, char const* file, long line ); // user defined
#if defined(BOOST_ASSERT_HANDLER_IS_NORETURN)
BOOST_NORETURN
#endif
void assertion_failed_msg( char const* expr, char const* msg, char const* function, char const* file, long line ); // user defined
} // namespace boost
//
// BOOST_ASSERT, BOOST_ASSERT_MSG, BOOST_ASSERT_IS_VOID
//
@@ -44,18 +63,6 @@
#include <boost/config.hpp> // for BOOST_LIKELY
#include <boost/current_function.hpp>
namespace boost
{
#if defined(BOOST_ASSERT_HANDLER_IS_NORETURN)
BOOST_NORETURN
#endif
void assertion_failed(char const * expr, char const * function, char const * file, long line); // user defined
#if defined(BOOST_ASSERT_HANDLER_IS_NORETURN)
BOOST_NORETURN
#endif
void assertion_failed_msg(char const * expr, char const * msg, char const * function, char const * file, long line); // user defined
} // namespace boost
#define BOOST_ASSERT(expr) (BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
#define BOOST_ASSERT_MSG(expr, msg) (BOOST_LIKELY(!!(expr))? ((void)0): ::boost::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))