assert.hpp 810 B

1234567891011121314151617181920212223242526272829
  1. // (C) Copyright Matt Borland 2021.
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. //
  6. // We deliberately use assert in here:
  7. //
  8. // boost-no-inspect
  9. #ifndef BOOST_MP_DETAIL_ASSERT_HPP
  10. #define BOOST_MP_DETAIL_ASSERT_HPP
  11. #include <boost/multiprecision/detail/standalone_config.hpp>
  12. #ifndef BOOST_MP_STANDALONE
  13. #include <boost/assert.hpp>
  14. #define BOOST_MP_ASSERT(expr) BOOST_ASSERT(expr)
  15. #define BOOST_MP_ASSERT_MSG(expr, msg) BOOST_ASSERT_MSG(expr, msg)
  16. #else // Standalone mode - use cassert
  17. #include <cassert>
  18. #define BOOST_MP_ASSERT(expr) assert(expr)
  19. #define BOOST_MP_ASSERT_MSG(expr, msg) assert((expr)&&(msg))
  20. #endif
  21. #endif // BOOST_MP_DETAIL_ASSERT_HPP