move assert function to a separate file

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24318 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2008-04-17 21:11:41 +00:00
parent 2fd9be2143
commit 2c73b5af3c
3 changed files with 27 additions and 9 deletions

View File

@ -42,6 +42,7 @@ liblyxsupport_la_SOURCES = \
FileMonitor.cpp \
RandomAccessList.h \
assert.h \
assert.cpp \
convert.cpp \
convert.h \
copied_ptr.h \

26
src/support/assert.cpp Normal file
View File

@ -0,0 +1,26 @@
/**
* \file assert.cpp
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author André Pönitz
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "support/debug.h"
#include <boost/assert.hpp>
namespace lyx {
void doAssert(char const * expr, char const * file, long line)
{
LYXERR0("ASSERTION " << expr << " VIOLATED IN " << file << ":" << line);
// comment this out if not needed
BOOST_ASSERT(false);
}
} // namespace lyx

View File

@ -17,8 +17,6 @@
#include "support/lstrings.h"
#include "support/FileName.h"
#include <boost/assert.hpp>
#include <iostream>
#include <iomanip>
@ -187,11 +185,4 @@ LyXErr & operator<<(LyXErr & l, ios_base &(*t)(ios_base &))
// The global instance
LyXErr lyxerr;
void doAssert(char const * expr, char const * file, long line)
{
LYXERR0("ASSERTION " << expr << " VIOLATED in " << file << ":" << line);
// comment this out if not needed
BOOST_ASSERT(false);
}
} // namespace lyx