assert.hpp

Go to the documentation of this file.
00001 //
00002 //  boost/assert.hpp - BOOST_ASSERT(expr)
00003 //
00004 //  Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
00005 //
00006 // Distributed under the Boost Software License, Version 1.0. (See
00007 // accompanying file LICENSE_1_0.txt or copy at
00008 // http://www.boost.org/LICENSE_1_0.txt)
00009 //
00010 //  Note: There are no include guards. This is intentional.
00011 //
00012 //  See http://www.boost.org/libs/utility/assert.html for documentation.
00013 //
00014 
00015 #undef BOOST_ASSERT
00016 
00017 #if defined(BOOST_DISABLE_ASSERTS)
00018 
00019 # define BOOST_ASSERT(expr) ((void)0)
00020 
00021 #elif defined(BOOST_ENABLE_ASSERT_HANDLER)
00022 
00023 #include <boost/current_function.hpp>
00024 
00025 namespace boost
00026 {
00027 
00028 void assertion_failed(char const * expr, char const * function, char const * file, long line); // user defined
00029 
00030 } // namespace boost
00031 
00032 #define BOOST_ASSERT(expr) ((expr)? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
00033 
00034 #else
00035 # include <assert.h> // .h to support old libraries w/o <cassert> - effect is the same
00036 # define BOOST_ASSERT(expr) assert(expr)
00037 #endif

Generated on Wed Jan 21 15:32:09 2009 for SystemC by  doxygen 1.5.5