]> git.lyx.org Git - lyx.git/blobdiff - src/boost.C
* lyx_main.C: remove duplicate function assertion_failed
[lyx.git] / src / boost.C
index 440b4ffd931aa6cd99d44b0e8c1d370b5eab121a..ff420ec555311da2a44d247c96dd3096e4951ec3 100644 (file)
 #include <exception>
 
 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();
 }
 
 
@@ -56,5 +56,4 @@ void assertion_failed(char const * expr, char const * function,
        lyx::support::abort();
 }
 
-
-}
+} // namespace boost