Files
utility/include/boost/assert.hpp
T

39 lines
1.0 KiB
C++
Raw Normal View History

2002-01-22 13:38:52 +00:00
//
2002-11-14 16:09:29 +00:00
// boost/assert.hpp - BOOST_ASSERT(expr)
2002-01-22 13:38:52 +00:00
//
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
//
// Permission to copy, use, modify, sell and distribute this software
// is granted provided this copyright notice appears in all copies.
// This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
//
2002-11-14 16:09:29 +00:00
// Note: There are no include guards. This is intentional.
2002-01-22 13:38:52 +00:00
//
2002-12-24 12:34:42 +00:00
// See http://www.boost.org/libs/utility/assert.html for documentation.
//
2002-12-23 02:43:12 +00:00
2002-11-14 16:09:29 +00:00
#undef BOOST_ASSERT
2002-01-22 13:38:52 +00:00
2002-11-14 16:09:29 +00:00
#if defined(BOOST_DISABLE_ASSERTS)
2002-01-22 13:38:52 +00:00
2002-11-14 16:09:29 +00:00
# define BOOST_ASSERT(expr) ((void)0)
2002-01-22 13:38:52 +00:00
2002-11-14 16:09:29 +00:00
#elif defined(BOOST_ENABLE_ASSERT_HANDLER)
2002-01-22 13:38:52 +00:00
#include <boost/current_function.hpp>
2002-11-14 16:09:29 +00:00
namespace boost
{
2002-11-14 16:09:29 +00:00
void assertion_failed(char const * expr, char const * function, char const * file, long line); // user defined
2002-01-22 13:38:52 +00:00
2002-11-14 16:09:29 +00:00
} // namespace boost
2002-01-22 13:38:52 +00:00
2002-11-14 16:09:29 +00:00
#define BOOST_ASSERT(expr) ((expr)? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
2002-01-22 13:38:52 +00:00
2002-11-14 16:09:29 +00:00
#else
# include <assert.h>
# define BOOST_ASSERT(expr) assert(expr)
#endif