]> git.lyx.org Git - lyx.git/blobdiff - src/boost.cpp
Update to boost 1.72
[lyx.git] / src / boost.cpp
index 7ae7433a1bea38ca2e537682e457789fba571ef3..ce1fb27abdc8d1ecc99a08626b5aa7e646c67bc5 100644 (file)
@@ -18,7 +18,6 @@
 
 #include <exception>
 #include <iomanip>
-#include <iostream>
 
 using namespace std;
 using lyx::lyxerr;
@@ -26,7 +25,7 @@ using lyx::lyxerr;
 namespace boost {
 
 #ifndef BOOST_NO_EXCEPTIONS
-void throw_exception(std::exception const & e)
+void throw_exception(exception const & e)
 {
        lyxerr << "Exception caught:\n" << e.what() << endl;
        LASSERT(false, /**/);
@@ -35,7 +34,7 @@ void throw_exception(std::exception const & e)
 
 
 void assertion_failed(char const * expr, char const * function,
-                     char const * file, long line)
+               char const * file, long line)
 {
        lyxerr << "Assertion triggered in " << function
               << " by failing check \"" << expr << "\""
@@ -47,4 +46,18 @@ void assertion_failed(char const * expr, char const * function,
        lyx::lyx_exit(1);
 }
 
+void assertion_failed_msg(char const * expr, char const * msg,
+               char const * function, char const * file, long line)
+{
+       lyxerr << "Assertion triggered in " << function
+              << " by failing check \"" << expr << "\""
+              << " with message \"" << msg << "\""
+              << " in file " << file << ":" << line << endl;
+
+       // FIXME: by default we exit here but we could also inform the user
+       // about the assertion and do the emergency cleanup without exiting.
+       // FIXME: do we have a list of exit codes defined somewhere?
+       lyx::lyx_exit(1);
+}
+
 } // namespace boost