12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #ifndef BOOST_GEOMETRY_CORE_ASSERT_HPP
- #define BOOST_GEOMETRY_CORE_ASSERT_HPP
- #include <boost/assert.hpp>
- #undef BOOST_GEOMETRY_ASSERT
- #undef BOOST_GEOMETRY_ASSERT_MSG
- #if defined(BOOST_GEOMETRY_ENABLE_ASSERT_HANDLER) || ( defined(BOOST_GEOMETRY_ENABLE_ASSERT_DEBUG_HANDLER) && !defined(NDEBUG) )
- #include <boost/config.hpp>
- #include <boost/current_function.hpp>
- namespace boost { namespace geometry
- {
- 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_GEOMETRY_ASSERT(expr) (BOOST_LIKELY(!!(expr))? ((void)0): ::boost::geometry::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
- #define BOOST_GEOMETRY_ASSERT_MSG(expr, msg) (BOOST_LIKELY(!!(expr))? ((void)0): ::boost::geometry::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
- #else
- #define BOOST_GEOMETRY_ASSERT(expr) BOOST_ASSERT(expr)
- #define BOOST_GEOMETRY_ASSERT_MSG(expr, msg) BOOST_ASSERT_MSG(expr, msg)
- #endif
- #endif
|