/src/contrib/boost/spirit/home/support/assert_msg.hpp

http://pythonocc.googlecode.com/ · C++ Header · 31 lines · 19 code · 6 blank · 6 comment · 1 complexity · fbbe134edc19d4ceea70852271c478e5 MD5 · raw file

  1. // Copyright (c) 2001-2010 Hartmut Kaiser
  2. //
  3. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. #if !defined(BOOST_SPIRIT_ASSERT_MSG_JUN_23_2009_0836AM)
  6. #define BOOST_SPIRIT_ASSERT_MSG_JUN_23_2009_0836AM
  7. #if defined(_MSC_VER)
  8. #pragma once
  9. #endif
  10. // Allow to work around the MPL problem in BOOST_MPL_ASSERT_MSG generating
  11. // multiple definition linker errors for certain compilers (VC++)
  12. #if BOOST_SPIRIT_DONT_USE_MPL_ASSERT_MSG != 0
  13. #include <boost/static_assert.hpp>
  14. #define BOOST_SPIRIT_ASSERT_MSG(Cond, Msg, Types) \
  15. BOOST_STATIC_ASSERT(Cond)
  16. #else
  17. #include <boost/mpl/assert.hpp>
  18. #define BOOST_SPIRIT_ASSERT_MSG(Cond, Msg, Types) \
  19. BOOST_MPL_ASSERT_MSG(Cond, Msg, Types)
  20. #endif
  21. #define BOOST_SPIRIT_ASSERT_MATCH(Domain, Expr) \
  22. BOOST_SPIRIT_ASSERT_MSG(( \
  23. boost::spirit::traits::matches<Domain, Expr>::value \
  24. ), error_invalid_expression, (Expr))
  25. #endif