]> git.lyx.org Git - lyx.git/blobdiff - src/support/LAssert.h
Small things in my tree.
[lyx.git] / src / support / LAssert.h
index cbcb53df647f1c7b586506b2d8cf526b706ef29b..f44f9ceaa201956f4f704e12669f28e2005b98ed 100644 (file)
@@ -8,43 +8,26 @@
 
 #ifdef ENABLE_ASSERTIONS
 
-//template<class X, class A> inline void Assert(A assertion)
-template<class A> inline void Assert(A assertion)
-{
-       //if (!assertion) throw X();
-       if (!assertion) {
-               lyx::abort();
-       }
-}
+extern void emergencySave();
 
-#ifdef HAVE_PARTIAL_SPECIALIZATION
-// Not too sure if this is the correct way to specialize
-template<class A> inline void Assert(A * ptr)
-{
-       Assert<void const *>(ptr);
-}
-template<> inline void Assert(void const * ptr)
+template<class A>
+inline
+void Assert(A assertion)
 {
-       if (!ptr) {
+       if (!assertion) {
+               ::emergencySave();
                lyx::abort();
        }
 }
-#endif /* HAVE_PARTIAL_SPECIALIZATION  */ 
-
-//template<class A, class E> inline void Assert(A assertion, E except)
-//{
-//     if (!assertion) except;
-//}
 
 #else
 
-template<class A> inline void Assert(A /*assertion*/) {}
+template<class A>
+inline
+void Assert(A /*assertion*/) {}
 
 #endif /* ENABLE_ASSERTIONS */
 
-
 //} // end of namespace LyX
-
-
 #endif /* LASSERT_H */