2003-10-14 21:30:23 +00:00
|
|
|
|
/**
|
2007-04-25 18:04:04 +00:00
|
|
|
|
* \file boost.cpp
|
2003-10-14 21:30:23 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
2007-11-29 07:04:28 +00:00
|
|
|
|
#include "support/debug.h"
|
2003-10-14 21:30:23 +00:00
|
|
|
|
|
|
|
|
|
#include <boost/assert.hpp>
|
|
|
|
|
|
|
|
|
|
#include <cstdlib>
|
|
|
|
|
#include <exception>
|
2007-11-29 07:04:28 +00:00
|
|
|
|
#include <ostream>
|
2003-10-14 21:30:23 +00:00
|
|
|
|
|
2007-12-12 10:16:00 +00:00
|
|
|
|
using namespace std;
|
2003-10-14 21:30:23 +00:00
|
|
|
|
|
|
|
|
|
namespace boost {
|
|
|
|
|
|
|
|
|
|
void throw_exception(std::exception const & e)
|
|
|
|
|
{
|
2006-10-21 00:16:43 +00:00
|
|
|
|
lyx::lyxerr << "Exception caught:\n"
|
2003-10-14 21:30:23 +00:00
|
|
|
|
<< e.what() << endl;
|
|
|
|
|
BOOST_ASSERT(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void assertion_failed(char const * expr, char const * function,
|
|
|
|
|
char const * file, long line)
|
|
|
|
|
{
|
2006-10-21 00:16:43 +00:00
|
|
|
|
lyx::lyxerr << "Assertion triggered in " << function
|
2003-10-14 21:30:23 +00:00
|
|
|
|
<< " by failing check \"" << expr << "\""
|
|
|
|
|
<< " in file " << file << ":" << line << endl;
|
|
|
|
|
::abort();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace boost
|