2008-04-12 15:11:59 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2008-04-30 08:26:40 +00:00
|
|
|
* \file support/lassert.h
|
2008-04-12 15:11:59 +00:00
|
|
|
*
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pönitz
|
2008-04-12 15:11:59 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LASSERT_H
|
|
|
|
#define LASSERT_H
|
|
|
|
|
2008-04-29 14:56:27 +00:00
|
|
|
#ifdef __cplusplus
|
2008-04-12 15:11:59 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
void doAssert(char const * expr, char const * file, long line);
|
|
|
|
|
2011-04-25 09:14:50 +00:00
|
|
|
/// Print demangled callstack to stderr
|
|
|
|
void printCallStack();
|
|
|
|
|
|
|
|
|
2008-04-12 15:11:59 +00:00
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#define LASSERT(expr, escape) \
|
|
|
|
if (expr) {} else { lyx::doAssert(#expr, __FILE__, __LINE__); escape; }
|
2008-04-29 14:56:27 +00:00
|
|
|
#endif
|
2008-04-12 15:11:59 +00:00
|
|
|
|
|
|
|
#endif // LASSERT
|