Tweak comments. Include <assert.h> and <boost/current_function.hpp> only

when needed.


[SVN r12446]
This commit is contained in:
Darin Adler
2002-01-22 18:28:33 +00:00
parent dbcc58d984
commit c7c09696db

View File

@ -18,26 +18,26 @@
// //
// When BOOST_DEBUG is not defined, it defaults to 0 (off) // When BOOST_DEBUG is not defined, it defaults to 0 (off)
// for backward compatibility with programs that do not // for compatibility with programs that do not expect asserts
// define a boost_error handler // in the smart pointer class templates.
// //
// After a reasonable transition period, the default can be // This default may be changed after an initial transition period.
// changed to something more appropriate.
// //
#ifndef BOOST_DEBUG #ifndef BOOST_DEBUG
#define BOOST_DEBUG 0 #define BOOST_DEBUG 0
#endif #endif
bool boost_error(char const * expr, char const * func, char const * file, long line);
#if BOOST_DEBUG #if BOOST_DEBUG
#include <boost/current_function.hpp>
#include <assert.h> #include <assert.h>
#ifndef BOOST_ASSERT #ifndef BOOST_ASSERT
#include <boost/current_function.hpp>
bool boost_error(char const * expr, char const * func, char const * file, long line);
# define BOOST_ASSERT(expr) ((expr) || !boost_error(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__) || (assert(expr), true)) # define BOOST_ASSERT(expr) ((expr) || !boost_error(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__) || (assert(expr), true))
#endif // #ifndef BOOST_ASSERT #endif // #ifndef BOOST_ASSERT
@ -47,6 +47,6 @@ bool boost_error(char const * expr, char const * func, char const * file, long l
#undef BOOST_ASSERT #undef BOOST_ASSERT
#define BOOST_ASSERT(expr) ((void)0) #define BOOST_ASSERT(expr) ((void)0)
#endif // #ifdef BOOST_DEBUG #endif // #if BOOST_DEBUG
#endif // #ifndef BOOST_ASSERT_HPP_INCLUDED #endif // #ifndef BOOST_ASSERT_HPP_INCLUDED