]> git.lyx.org Git - lyx.git/blobdiff - src/support/LAssert.h
change call to shared_ptr::reset, move some using declarations around
[lyx.git] / src / support / LAssert.h
index f44f9ceaa201956f4f704e12669f28e2005b98ed..6a937266024f62faa7a5fa1e7b9fa94b6b73e94c 100644 (file)
@@ -4,30 +4,38 @@
 
 #include "support/lyxlib.h"
 
-//namespace LyX {
+extern void emergencyCleanup();
 
-#ifdef ENABLE_ASSERTIONS
+namespace lyx {
 
-extern void emergencySave();
+#ifdef ENABLE_ASSERTIONS
 
+/** Live assertion.
+    This is a debug tool to ensure that the assertion holds. If it don't hole
+    we run #emergencyCleanup()# and then #lyx::abort".
+    @param assertion this should evaluate to true unless you want an abort.
+*/
 template<class A>
 inline
 void Assert(A assertion)
 {
        if (!assertion) {
-               ::emergencySave();
+               ::emergencyCleanup();
                lyx::abort();
        }
 }
 
 #else
 
+/** Dummy assertion.
+    When compiling without assertions we use this no-op function.
+*/
 template<class A>
 inline
 void Assert(A /*assertion*/) {}
 
 #endif /* ENABLE_ASSERTIONS */
 
-//} // end of namespace LyX
-#endif /* LASSERT_H */
+} // end of namespace LyX
 
+#endif /* LASSERT_H */