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.
|
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author Lars Gullik Bjønnes
|
2003-10-14 21:30:23 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include <boost/assert.hpp>
|
|
|
|
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <exception>
|
2013-05-31 09:37:55 +00:00
|
|
|
#include <iostream>
|
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 {
|
|
|
|
|
2010-03-07 11:03:23 +00:00
|
|
|
void throw_exception(std::exception const & e)
|
2003-10-14 21:30:23 +00:00
|
|
|
{
|
2013-05-31 09:37:55 +00:00
|
|
|
cerr << "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)
|
|
|
|
{
|
2013-05-31 09:37:55 +00:00
|
|
|
cerr << "Assertion triggered in " << function
|
|
|
|
<< " by failing check \"" << expr << "\""
|
|
|
|
<< " in file " << file << ":" << line << endl;
|
2003-10-14 21:30:23 +00:00
|
|
|
::abort();
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace boost
|