Ticket #6451: assert.hpp.patch
File assert.hpp.patch, 2.2 KB (added by , 11 years ago) |
---|
-
assert.hpp
42 42 char const * function, char const * file, long line); // user defined 43 43 } // namespace boost 44 44 45 // BOOST_CURRENT_FUNCTION can produce very long names, that may lead to huge size of output files. 46 // So allow user to define current function macro (for example to shorter __FUNCTION__ 47 // macro or to "(unknown)") 48 #ifndef BOOST_ASSERT_CURRENT_FUNCTION_NAME 49 # define BOOST_ASSERT_CURRENT_FUNCTION_NAME BOOST_CURRENT_FUNCTION 50 #endif 51 45 52 #define BOOST_ASSERT(expr) ((expr) \ 46 53 ? ((void)0) \ 47 : ::boost::assertion_failed(#expr, BOOST_ CURRENT_FUNCTION, __FILE__, __LINE__))54 : ::boost::assertion_failed(#expr, BOOST_ASSERT_CURRENT_FUNCTION_NAME, __FILE__, __LINE__)) 48 55 49 56 #else 50 57 # include <assert.h> // .h to support old libraries w/o <cassert> - effect is the same … … 57 64 58 65 # undef BOOST_ASSERT_MSG 59 66 67 #if !defined(BOOST_DISABLE_ASSERTS) && !defined(NDEBUG) 68 69 // BOOST_CURRENT_FUNCTION can produce very long names, that may lead to huge size of output files. 70 // So allow user to define current function macro (for example to shorter __FUNCTION__ 71 // macro or to "(unknown)") 72 #ifndef BOOST_ASSERT_MSG_CURRENT_FUNCTION_NAME 73 # define BOOST_ASSERT_MSG_CURRENT_FUNCTION_NAME BOOST_CURRENT_FUNCTION 74 #endif 75 76 #endif 77 60 78 #if defined(BOOST_DISABLE_ASSERTS) || defined(NDEBUG) 61 79 62 80 #define BOOST_ASSERT_MSG(expr, msg) ((void)0) … … 73 91 74 92 #define BOOST_ASSERT_MSG(expr, msg) ((expr) \ 75 93 ? ((void)0) \ 76 : ::boost::assertion_failed_msg(#expr, msg, BOOST_ CURRENT_FUNCTION, __FILE__, __LINE__))94 : ::boost::assertion_failed_msg(#expr, msg, BOOST_ASSERT_MSG_CURRENT_FUNCTION_NAME, __FILE__, __LINE__)) 77 95 78 96 #else 79 97 #ifndef BOOST_ASSERT_HPP … … 116 134 #define BOOST_ASSERT_MSG(expr, msg) ((expr) \ 117 135 ? ((void)0) \ 118 136 : ::boost::assertion::detail::assertion_failed_msg(#expr, msg, \ 119 BOOST_ CURRENT_FUNCTION, __FILE__, __LINE__))137 BOOST_ASSERT_MSG_CURRENT_FUNCTION_NAME, __FILE__, __LINE__)) 120 138 #endif 121 139 122 140 //--------------------------------------------------------------------------------------//