]> git.lyx.org Git - lyx.git/blobdiff - src/support/LAssert.C
split LyXText::rowlist_ into individual Paragraph::rows_ chunks
[lyx.git] / src / support / LAssert.C
index 980a1aa6101c3451bec3919b2f0be87b19623ffa..30248b0807156ce76bd575eee5c95cd481a0961f 100644 (file)
 #include <config.h>
 
 #include "LAssert.h"
+#include "support/lyxlib.h"
 
 #ifdef ENABLE_ASSERTIONS
 #include "lyx_main.h"
 
-void emergencyCleanup() {
+namespace lyx {
+namespace support {
+
+namespace {
+
+void emergencyCleanup()
+{
        static bool didCleanup;
        if (didCleanup)
                return;
@@ -25,4 +32,17 @@ void emergencyCleanup() {
        LyX::emergencyCleanup();
 }
 
+} // namespace anon
+
+void Assert(bool assertion)
+{
+       if (!assertion) {
+               emergencyCleanup();
+               lyx::support::abort();
+       }
+}
+
+} // namespace support
+} // namespace lyx
+
 #endif