PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

/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
 6#if !defined(BOOST_SPIRIT_ASSERT_MSG_JUN_23_2009_0836AM)
 7#define BOOST_SPIRIT_ASSERT_MSG_JUN_23_2009_0836AM
 8
 9#if defined(_MSC_VER)
10#pragma once
11#endif
12
13// Allow to work around the MPL problem in BOOST_MPL_ASSERT_MSG generating
14// multiple definition linker errors for certain compilers (VC++)
15#if BOOST_SPIRIT_DONT_USE_MPL_ASSERT_MSG != 0
16#include <boost/static_assert.hpp>
17#define BOOST_SPIRIT_ASSERT_MSG(Cond, Msg, Types)                             \
18        BOOST_STATIC_ASSERT(Cond)
19#else
20#include <boost/mpl/assert.hpp>
21#define BOOST_SPIRIT_ASSERT_MSG(Cond, Msg, Types)                             \
22        BOOST_MPL_ASSERT_MSG(Cond, Msg, Types)
23#endif
24
25#define BOOST_SPIRIT_ASSERT_MATCH(Domain, Expr)                               \
26        BOOST_SPIRIT_ASSERT_MSG((                                             \
27            boost::spirit::traits::matches<Domain, Expr>::value               \
28        ), error_invalid_expression, (Expr))
29
30#endif
31