X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fboost.C;h=ff420ec555311da2a44d247c96dd3096e4951ec3;hb=35204f8f33d7400a5fefeffea533fb4cb4097211;hp=b6b4ae38ceb09d71545ffa5da396e1d225aa9bec;hpb=1331aacf5939e40c32faa075cbc874fc3d88052e;p=lyx.git diff --git a/src/boost.C b/src/boost.C index b6b4ae38ce..ff420ec555 100644 --- a/src/boost.C +++ b/src/boost.C @@ -19,41 +19,41 @@ #include using std::endl; +using lyx::lyxerr; +using lyx::LyX; namespace boost { +#ifndef BOOST_NO_EXCEPTIONS void throw_exception(std::exception const & e) { lyxerr << "Exception caught:\n" << e.what() << endl; BOOST_ASSERT(false); } +#endif -namespace { - void emergencyCleanup() { - static bool didCleanup; - if (didCleanup) - return; - - didCleanup = true; + static bool didCleanup; + if (didCleanup) + return; - LyX::emergencyCleanup(); -} + didCleanup = true; + LyX::cref().emergencyCleanup(); } void assertion_failed(char const * expr, char const * function, char const * file, long line) { - lyxerr << "Assertion triggered in " << function << " by \"" << - expr << " in file " << file << ":" << line << endl; + lyxerr << "Assertion triggered in " << function + << " by failing check \"" << expr << "\"" + << " in file " << file << ":" << line << endl; emergencyCleanup(); lyx::support::abort(); } - -} +} // namespace boost