X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fboost.cpp;h=646d4e4dfb3960c48e6ad6bf1be816fbba611a2d;hb=bb277747d2fc128d65edb55662d075ce44100bc7;hp=7ae7433a1bea38ca2e537682e457789fba571ef3;hpb=f1cba8ff64b369792fd49f5ddf90e8126ab476ac;p=lyx.git diff --git a/src/boost.cpp b/src/boost.cpp index 7ae7433a1b..646d4e4dfb 100644 --- a/src/boost.cpp +++ b/src/boost.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include using namespace std; using lyx::lyxerr; @@ -26,7 +26,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 +35,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 +47,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