]> git.lyx.org Git - lyx.git/blob - src/support/LAssert.h
Some portability fixes; fix header of linuxdoc files.
[lyx.git] / src / support / LAssert.h
1 // -*- C++ -*-
2 #ifndef LASSERT_H
3 #define LASSERT_H
4
5 #include "support/lyxlib.h"
6
7 //namespace LyX {
8
9 #ifdef ENABLE_ASSERTIONS
10
11 //template<class X, class A> inline void Assert(A assertion)
12 template<class A> inline void Assert(A assertion)
13 {
14         //if (!assertion) throw X();
15         if (!assertion) {
16                 lyx::abort();
17         }
18 }
19
20
21 //template<class A, class E> inline void Assert(A assertion, E except)
22 //{
23 //      if (!assertion) except;
24 //}
25
26 #else
27
28 template<class A> inline void Assert(A /*assertion*/) {}
29
30 #endif /* ENABLE_ASSERTIONS */
31
32
33 //} // end of namespace LyX
34
35
36 #endif /* LASSERT_H */
37