// -*- 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
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 */