]> git.lyx.org Git - lyx.git/blob - src/boost.cpp
rename MathArray into MathData
[lyx.git] / src / boost.cpp
1 /**
2  * \file boost.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Lars Gullik Bjønnes
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "LyX.h"
14 #include "debug.h"
15 #include "support/lyxlib.h"
16
17 #include <boost/assert.hpp>
18
19 #include <exception>
20
21 using std::endl;
22 using lyx::lyxerr;
23 using lyx::LyX;
24
25 namespace boost {
26
27 #ifndef BOOST_NO_EXCEPTIONS
28 void throw_exception(std::exception const & e)
29 {
30         lyxerr << "Exception caught:\n"
31             << e.what() << endl;
32         BOOST_ASSERT(false);
33 }
34 #endif
35
36
37 void emergencyCleanup()
38 {
39         static bool didCleanup;
40         if (didCleanup)
41                 return;
42
43         didCleanup = true;
44
45         LyX::cref().emergencyCleanup();
46 }
47
48
49 void assertion_failed(char const * expr, char const * function,
50                       char const * file, long line)
51 {
52         lyxerr << "Assertion triggered in " << function
53                << " by failing check \"" << expr << "\""
54                << " in file " << file << ":" << line << endl;
55         emergencyCleanup();
56         lyx::support::abort();
57 }
58
59 } // namespace boost