1999-10-02 16:21:10 +00:00
|
|
|
// -*- C++ -*-
|
1999-11-22 16:19:48 +00:00
|
|
|
#ifndef LASSERT_H
|
|
|
|
#define LASSERT_H
|
1999-10-02 16:21:10 +00:00
|
|
|
|
2000-01-17 21:01:30 +00:00
|
|
|
#include "support/lyxlib.h"
|
|
|
|
|
1999-10-02 16:21:10 +00:00
|
|
|
//namespace LyX {
|
|
|
|
|
1999-12-16 14:16:42 +00:00
|
|
|
#ifdef ENABLE_ASSERTIONS
|
|
|
|
|
1999-10-02 16:21:10 +00:00
|
|
|
template<class A> inline void Assert(A assertion)
|
|
|
|
{
|
|
|
|
if (!assertion) {
|
2000-01-17 21:01:30 +00:00
|
|
|
lyx::abort();
|
1999-10-02 16:21:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
1999-12-21 06:10:21 +00:00
|
|
|
template<class A> inline void Assert(A /*assertion*/) {}
|
1999-12-16 14:16:42 +00:00
|
|
|
|
|
|
|
#endif /* ENABLE_ASSERTIONS */
|
1999-10-02 16:21:10 +00:00
|
|
|
|
|
|
|
//} // end of namespace LyX
|
1999-12-16 14:16:42 +00:00
|
|
|
#endif /* LASSERT_H */
|
|
|
|
|