Line | |
---|
1 | //
|
---|
2 | // boost/assert.hpp - BOOST_ASSERT(expr)
|
---|
3 | //
|
---|
4 | // Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
|
---|
5 | //
|
---|
6 | // Distributed under the Boost Software License, Version 1.0. (See
|
---|
7 | // accompanying file LICENSE_1_0.txt or copy at
|
---|
8 | // http://www.boost.org/LICENSE_1_0.txt)
|
---|
9 | //
|
---|
10 | // Note: There are no include guards. This is intentional.
|
---|
11 | //
|
---|
12 | // See http://www.boost.org/libs/utility/assert.html for documentation.
|
---|
13 | //
|
---|
14 |
|
---|
15 | #undef BOOST_ASSERT
|
---|
16 |
|
---|
17 | #if defined(BOOST_DISABLE_ASSERTS)
|
---|
18 |
|
---|
19 | # define BOOST_ASSERT(expr) ((void)0)
|
---|
20 |
|
---|
21 | #elif defined(BOOST_ENABLE_ASSERT_HANDLER)
|
---|
22 |
|
---|
23 | #include <boost/current_function.hpp>
|
---|
24 |
|
---|
25 | namespace boost
|
---|
26 | {
|
---|
27 |
|
---|
28 | void assertion_failed(char const * expr, char const * function, char const * file, long line); // user defined
|
---|
29 |
|
---|
30 | } // namespace boost
|
---|
31 |
|
---|
32 | #define BOOST_ASSERT(expr) ((expr)? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
|
---|
33 |
|
---|
34 | #else
|
---|
35 | # include <assert.h> // .h to support old libraries w/o <cassert> - effect is the same
|
---|
36 | # define BOOST_ASSERT(expr) assert(expr)
|
---|
37 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.