]> git.lyx.org Git - lyx.git/blob - src/client/boost.cpp
Update to boost 1.72
[lyx.git] / src / client / 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 "support/debug.h"
14
15 #include <boost/assert.hpp>
16
17 #include <cstdlib>
18 #include <exception>
19 #include <iostream>
20
21 using namespace std;
22 using lyx::lyxerr;
23
24 namespace boost {
25
26 #ifndef BOOST_NO_EXCEPTIONS
27 void throw_exception(exception const & e)
28 {
29         lyxerr << "Exception caught:\n" << e.what() << endl;
30         BOOST_ASSERT(false);
31 }
32 #endif
33
34
35 void assertion_failed(char const * expr, char const * function,
36                 char const * file, long line)
37 {
38         lyxerr << "Assertion triggered in " << function
39                << " by failing check \"" << expr << "\""
40                << " in file " << file << ":" << line << endl;
41         ::abort();
42 }
43
44
45 void assertion_failed_msg(char const * expr, char const * msg,
46                 char const * function, char const * file, long line)
47 {
48         lyxerr << "Assertion triggered in " << function
49                << " by failing check \"" << expr << "\""
50                << " with message \"" << msg << "\""
51                << " in file " << file << ":" << line << endl;
52
53         ::abort();
54 }
55
56 } // namespace boost