12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- #undef BOOST_ASSERT
- #undef BOOST_ASSERT_MSG
- #undef BOOST_ASSERT_IS_VOID
- #if defined(BOOST_DISABLE_ASSERTS) || ( defined(BOOST_ENABLE_ASSERT_DEBUG_HANDLER) && defined(NDEBUG) )
- # define BOOST_ASSERT(expr) ((void)0)
- # define BOOST_ASSERT_MSG(expr, msg) ((void)0)
- # define BOOST_ASSERT_IS_VOID
- #elif defined(BOOST_ENABLE_ASSERT_HANDLER) || ( defined(BOOST_ENABLE_ASSERT_DEBUG_HANDLER) && !defined(NDEBUG) )
- #include <boost/config.hpp>
- #include <boost/current_function.hpp>
- namespace boost
- {
- void assertion_failed(char const * expr, char const * function, char const * file, long line);
- void assertion_failed_msg(char const * expr, char const * msg, char const * function, char const * file, long line);
- }
- #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__))
- #else
- # include <assert.h>
- # define BOOST_ASSERT(expr) assert(expr)
- # define BOOST_ASSERT_MSG(expr, msg) assert((expr)&&(msg))
- #if defined(NDEBUG)
- # define BOOST_ASSERT_IS_VOID
- #endif
- #endif
- #undef BOOST_VERIFY
- #undef BOOST_VERIFY_MSG
- #if defined(BOOST_DISABLE_ASSERTS) || ( !defined(BOOST_ENABLE_ASSERT_HANDLER) && defined(NDEBUG) )
- # define BOOST_VERIFY(expr) ((void)(expr))
- # define BOOST_VERIFY_MSG(expr, msg) ((void)(expr))
- #else
- # define BOOST_VERIFY(expr) BOOST_ASSERT(expr)
- # define BOOST_VERIFY_MSG(expr, msg) BOOST_ASSERT_MSG(expr,msg)
- #endif
|