debug_assert.hpp 658 B

123456789101112131415161718192021
  1. // Copyright (C) 2020 T. Zachary Laine
  2. //
  3. // Distributed under the Boost Software License, Version 1.0. (See
  4. // accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. #ifndef BOOST_PARSER_DETAIL_DEBUG_ASSERT_HPP
  7. #define BOOST_PARSER_DETAIL_DEBUG_ASSERT_HPP
  8. #if __has_include(<boost/assert.hpp>)
  9. #include <boost/assert.hpp>
  10. #define BOOST_PARSER_DEBUG_ASSERT(condition) BOOST_ASSERT(condition)
  11. #define BOOST_PARSER_HAVE_BOOST_ASSERT
  12. #elif defined(BOOST_DISABLE_ASSERTS)
  13. #define BOOST_PARSER_DEBUG_ASSERT(condition) ((void)0)
  14. #else
  15. #include <cassert>
  16. #define BOOST_PARSER_DEBUG_ASSERT(condition) assert(condition)
  17. #endif
  18. #endif