lyx_mirror/src/support/LAssert.h

34 lines
419 B
C
Raw Normal View History

// -*- C++ -*-
#ifndef LASSERT_H
#define LASSERT_H
#include "support/lyxlib.h"
//namespace LyX {
#ifdef ENABLE_ASSERTIONS
extern void emergencySave();
template<class A>
inline
void Assert(A assertion)
{
if (!assertion) {
::emergencySave();
lyx::abort();
}
}
#else
template<class A>
inline
void Assert(A /*assertion*/) {}
#endif /* ENABLE_ASSERTIONS */
//} // end of namespace LyX
#endif /* LASSERT_H */