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