]> git.lyx.org Git - features.git/blob - src/support/LAssert.h
FILMagain changes (will need some work)
[features.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 extern void emergencySave();
12
13 template<class A>
14 inline
15 void Assert(A assertion)
16 {
17         if (!assertion) {
18                 ::emergencySave();
19                 lyx::abort();
20         }
21 }
22
23 #else
24
25 template<class A>
26 inline
27 void Assert(A /*assertion*/) {}
28
29 #endif /* ENABLE_ASSERTIONS */
30
31 //} // end of namespace LyX
32 #endif /* LASSERT_H */
33