]> git.lyx.org Git - lyx.git/blob - boost/boost/assert.hpp
754ebb954bce0b0e7474681f38d871d74eb18323
[lyx.git] / boost / boost / assert.hpp
1 //
2 //  boost/assert.hpp - BOOST_ASSERT(expr)
3 //
4 //  Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
5 //
6 //  Permission to copy, use, modify, sell and distribute this software
7 //  is granted provided this copyright notice appears in all copies.
8 //  This software is provided "as is" without express or implied
9 //  warranty, and with no claim as to its suitability for any purpose.
10 //
11 //  Note: There are no include guards. This is intentional.
12 //
13 //  See http://www.boost.org/libs/utility/assert.html for documentation.
14 //
15
16 #undef BOOST_ASSERT
17
18 #if defined(BOOST_DISABLE_ASSERTS)
19
20 # define BOOST_ASSERT(expr) ((void)0)
21
22 #elif defined(BOOST_ENABLE_ASSERT_HANDLER)
23
24 #include <boost/current_function.hpp>
25
26 namespace boost
27 {
28
29 void assertion_failed(char const * expr, char const * function, char const * file, long line); // user defined
30
31 } // namespace boost
32
33 #define BOOST_ASSERT(expr) ((expr)? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
34
35 #else
36 # include <assert.h>
37 # define BOOST_ASSERT(expr) assert(expr)
38 #endif