]> git.lyx.org Git - lyx.git/blobdiff - src/support/LAssert.h
fix crossref label list, some debug messages + various
[lyx.git] / src / support / LAssert.h
index 0463c9e7306c75c6943500c4e08dd9bf5051f16b..071f50919d85234c9d465f88a3b74de6e4fc0b75 100644 (file)
@@ -2,42 +2,25 @@
 #ifndef LASSERT_H
 #define LASSERT_H
 
+#include "support/lyxlib.h"
+
 //namespace LyX {
 
-#define HAVE_TEMPLATE
-#ifdef HAVE_TEMPLATE
-//template<class X, class A> inline void Assert(A assertion)
+#ifdef ENABLE_ASSERTIONS
+
 template<class A> inline void Assert(A assertion)
 {
-       //if (!assertion) throw X();
        if (!assertion) {
-               abort();
-       }
-}
-
-#ifdef HAVE_PARTIAL_SPECIALIZATION
-// Not too sure if this is the correct way to specialize
-template<class A> inline void Assert(A * ptr)
-{
-       if (!ptr) {
-               abort();
+               lyx::abort();
        }
 }
-#endif
-
-//template<class A, class E> inline void Assert(A assertion, E except)
-//{
-//     if (!assertion) except;
-//}
 
 #else
 
-inline void lyx_assert(...)
-{
-       // nothing
-}
+template<class A> inline void Assert(A /*assertion*/) {}
 
-#endif
-#endif
+#endif /* ENABLE_ASSERTIONS */
 
 //} // end of namespace LyX
+#endif /* LASSERT_H */
+