debug.hpp 746 B

1234567891011121314151617181920
  1. #ifndef BOOST_CONTRACT_DETAIL_DEBUG_HPP_
  2. #define BOOST_CONTRACT_DETAIL_DEBUG_HPP_
  3. // Copyright (C) 2008-2018 Lorenzo Caminiti
  4. // Distributed under the Boost Software License, Version 1.0 (see accompanying
  5. // file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt).
  6. // See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
  7. // Usually, never #defined (so "debug" assertions always in code).
  8. #ifdef BOOST_CONTRACT_DETAIL_NDEBUG
  9. #define BOOST_CONTRACT_DETAIL_DEBUG(cond) /* nothing */
  10. #else
  11. #include <boost/assert.hpp>
  12. // Extra parenthesis around BOOST_ASSERT to be safe because its is a macro.
  13. #define BOOST_CONTRACT_DETAIL_DEBUG(cond) (BOOST_ASSERT(cond))
  14. #endif
  15. #endif // #include guard