X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fboost.C;h=217649650b45f6b2f1ec7d7dc3e912785cd04f34;hb=e94889a041628203c50b66b9a4add63210de6928;hp=e4d3cf44ed293fc301943ff19854195cf39ccef4;hpb=fcdb71906b6f41dd5719608b1e57286037fc5f2c;p=lyx.git diff --git a/src/boost.C b/src/boost.C index e4d3cf44ed..217649650b 100644 --- a/src/boost.C +++ b/src/boost.C @@ -12,6 +12,7 @@ #include "lyx_main.h" #include "debug.h" +#include "support/lyxlib.h" #include @@ -21,25 +22,26 @@ using std::endl; 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; + static bool didCleanup; + if (didCleanup) + return; - didCleanup = true; + didCleanup = true; - LyX::emergencyCleanup(); + LyX::cref().emergencyCleanup(); } } @@ -48,10 +50,11 @@ void 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(); - assert(false); + lyx::support::abort(); }