]> git.lyx.org Git - lyx.git/blob - boost/boost/assert.hpp
complie fix
[lyx.git] / boost / boost / assert.hpp
1 #ifndef BOOST_ASSERT_HPP_INCLUDED
2 #define BOOST_ASSERT_HPP_INCLUDED
3
4 #if _MSC_VER >= 1020
5 #pragma once
6 #endif
7
8 //
9 //  boost/assert.hpp
10 //
11 //  Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
12 //
13 //  Permission to copy, use, modify, sell and distribute this software
14 //  is granted provided this copyright notice appears in all copies.
15 //  This software is provided "as is" without express or implied
16 //  warranty, and with no claim as to its suitability for any purpose.
17 //
18
19 //
20 //  When BOOST_DEBUG is not defined, it defaults to 0 (off)
21 //  for compatibility with programs that do not expect asserts
22 //  in the smart pointer class templates.
23 //
24 //  This default may be changed after an initial transition period.
25 //
26
27 #ifndef BOOST_DEBUG
28 #define BOOST_DEBUG 0
29 #endif
30
31 #if BOOST_DEBUG
32
33 #include <assert.h>
34
35 #ifndef BOOST_ASSERT
36
37 #include <boost/current_function.hpp>
38
39 bool boost_error(char const * expr, char const * func, char const * file, long line);
40
41 # define BOOST_ASSERT(expr) ((expr) || !boost_error(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__) || (assert(expr), true))
42
43 #endif // #ifndef BOOST_ASSERT
44
45 #else // #if BOOST_DEBUG
46
47 #undef BOOST_ASSERT
48 #define BOOST_ASSERT(expr) ((void)0)
49
50 #endif // #if BOOST_DEBUG
51
52 #endif // #ifndef BOOST_ASSERT_HPP_INCLUDED