]> git.lyx.org Git - lyx.git/blobdiff - src/support/LAssert.h
zlib stuff
[lyx.git] / src / support / LAssert.h
index f4d92782388bd6f654664eb887fe2827a470bbfc..e791820285f738463b14b693caa78cf12e6094c2 100644 (file)
@@ -1,30 +1,40 @@
 // -*- C++ -*-
+/**
+ * \file LAssert.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Lars Gullik Bjønnes
+ *
+ * Full author contact details are available in file CREDITS
+ */
+
 #ifndef LASSERT_H
 #define LASSERT_H
 
-#include "support/lyxlib.h"
-
-//namespace LyX {
+namespace lyx {
+namespace support {
 
 #ifdef ENABLE_ASSERTIONS
 
-template<class A>
-inline
-void Assert(A assertion)
-{
-       if (!assertion) {
-               lyx::abort();
-       }
-}
+/** 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.
+*/
+void Assert(bool assertion);
 
 #else
 
-template<class A>
+/** Dummy assertion.
+    When compiling without assertions we use this no-op function.
+*/
 inline
-void Assert(A /*assertion*/) {}
+void Assert(bool /*assertion*/) {}
 
 #endif /* ENABLE_ASSERTIONS */
 
-//} // end of namespace LyX
-#endif /* LASSERT_H */
+} // namespace support
+} // namespace lyx
 
+#endif /* LASSERT_H */