Index: assert.hpp =================================================================== --- assert.hpp (revision 76706) +++ assert.hpp (working copy) @@ -42,9 +42,16 @@ char const * function, char const * file, long line); // user defined } // namespace boost +// BOOST_CURRENT_FUNCTION can produce very long names, that may lead to huge size of output files. +// So allow user to define current function macro (for example to shorter __FUNCTION__ +// macro or to "(unknown)") +#ifndef BOOST_ASSERT_CURRENT_FUNCTION_NAME +# define BOOST_ASSERT_CURRENT_FUNCTION_NAME BOOST_CURRENT_FUNCTION +#endif + #define BOOST_ASSERT(expr) ((expr) \ ? ((void)0) \ - : ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) + : ::boost::assertion_failed(#expr, BOOST_ASSERT_CURRENT_FUNCTION_NAME, __FILE__, __LINE__)) #else # include // .h to support old libraries w/o - effect is the same @@ -57,6 +64,17 @@ # undef BOOST_ASSERT_MSG +#if !defined(BOOST_DISABLE_ASSERTS) && !defined(NDEBUG) + + // BOOST_CURRENT_FUNCTION can produce very long names, that may lead to huge size of output files. + // So allow user to define current function macro (for example to shorter __FUNCTION__ + // macro or to "(unknown)") + #ifndef BOOST_ASSERT_MSG_CURRENT_FUNCTION_NAME + # define BOOST_ASSERT_MSG_CURRENT_FUNCTION_NAME BOOST_CURRENT_FUNCTION + #endif + +#endif + #if defined(BOOST_DISABLE_ASSERTS) || defined(NDEBUG) #define BOOST_ASSERT_MSG(expr, msg) ((void)0) @@ -73,7 +91,7 @@ #define BOOST_ASSERT_MSG(expr, msg) ((expr) \ ? ((void)0) \ - : ::boost::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) + : ::boost::assertion_failed_msg(#expr, msg, BOOST_ASSERT_MSG_CURRENT_FUNCTION_NAME, __FILE__, __LINE__)) #else #ifndef BOOST_ASSERT_HPP @@ -116,7 +134,7 @@ #define BOOST_ASSERT_MSG(expr, msg) ((expr) \ ? ((void)0) \ : ::boost::assertion::detail::assertion_failed_msg(#expr, msg, \ - BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) + BOOST_ASSERT_MSG_CURRENT_FUNCTION_NAME, __FILE__, __LINE__)) #endif //--------------------------------------------------------------------------------------//