mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 05:33:33 +00:00
0eccdd1c36
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@162 a592a061-630c-0410-9148-cb99ea01b6c8
44 lines
676 B
C++
44 lines
676 B
C++
// -*- C++ -*-
|
|
#ifndef _LASSERT_H_
|
|
#define _LASSERT_H_
|
|
|
|
//namespace LyX {
|
|
|
|
#define HAVE_TEMPLATE
|
|
#ifdef HAVE_TEMPLATE
|
|
//template<class X, class A> inline void Assert(A assertion)
|
|
template<class A> inline void Assert(A assertion)
|
|
{
|
|
//if (!assertion) throw X();
|
|
if (!assertion) {
|
|
abort();
|
|
}
|
|
}
|
|
|
|
#ifdef HAVE_PARTIAL_SPECIALIZATION
|
|
// Not too sure if this is the correct way to specialize
|
|
template<class A> inline void Assert(A * ptr)
|
|
{
|
|
if (!ptr) {
|
|
abort();
|
|
}
|
|
}
|
|
#endif
|
|
|
|
//template<class A, class E> inline void Assert(A assertion, E except)
|
|
//{
|
|
// if (!assertion) except;
|
|
//}
|
|
|
|
#else
|
|
|
|
inline void lyx_assert(...)
|
|
{
|
|
// nothing
|
|
}
|
|
|
|
#endif
|
|
#endif
|
|
|
|
//} // end of namespace LyX
|