From 2008e4d228fd757a10b59dc206d63295e0aeec4f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 27 Jun 2026 15:37:31 +0300 Subject: [PATCH] Unconditionally declare boost::assertion_failed, boost::assertion_failed_msg --- include/boost/assert.hpp | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/include/boost/assert.hpp b/include/boost/assert.hpp index 48c9bcc..50948fb 100644 --- a/include/boost/assert.hpp +++ b/include/boost/assert.hpp @@ -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 // for BOOST_LIKELY #include -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__))