]> git.lyx.org Git - lyx.git/blobdiff - src/support/LAssert.h
zlib stuff
[lyx.git] / src / support / LAssert.h
index 65b8618b8743a56bb93569d4793367d1224b9657..e791820285f738463b14b693caa78cf12e6094c2 100644 (file)
@@ -1,10 +1,10 @@
 // -*- C++ -*-
 /**
- * \file LAssert.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
+ * \author Lars Gullik Bjønnes
  *
  * Full author contact details are available in file CREDITS
  */
 #ifndef LASSERT_H
 #define LASSERT_H
 
-#include "support/lyxlib.h"
-
-extern void emergencyCleanup();
-
 namespace lyx {
+namespace support {
 
 #ifdef ENABLE_ASSERTIONS
 
@@ -25,27 +22,19 @@ namespace lyx {
     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) {
-               ::emergencyCleanup();
-               lyx::abort();
-       }
-}
+void Assert(bool assertion);
 
 #else
 
 /** Dummy assertion.
     When compiling without assertions we use this no-op function.
 */
-template<class A>
 inline
-void Assert(A /*assertion*/) {}
+void Assert(bool /*assertion*/) {}
 
 #endif /* ENABLE_ASSERTIONS */
 
-} // end of namespace LyX
+} // namespace support
+} // namespace lyx
 
 #endif /* LASSERT_H */