Bugfix: moved ai_assert condition evaluation out of the assert function to avoid constructing two expensive strings on every single call.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@525 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
ulfjorensen
2010-01-06 22:04:31 +00:00
parent c508bafbad
commit 185c30c85b
3 changed files with 10 additions and 8 deletions

View File

@@ -10,12 +10,14 @@
// Set a breakpoint using win32, else line, file and message will be returned and progam ends with
// errrocode = 1
void Assimp::aiAssert (bool expression, const std::string &message, unsigned int uiLine, const std::string &file)
void Assimp::aiAssert (const std::string &message, unsigned int uiLine, const std::string &file)
{
if (!expression)
{
// FIX (Aramis): changed std::cerr to std::cout that the message appears in VS' output window ...
std::cout << "File :" << file << ", line " << uiLine << " : " << message << std::endl;
// moved expression testing out of the function and into the macro to avoid constructing
// two std::string on every single ai_assert test
// if (!expression)
{
// FIX (Aramis): changed std::cerr to std::cout that the message appears in VS' output window ...
std::cout << "File :" << file << ", line " << uiLine << " : " << message << std::endl;
#ifdef _WIN32
#ifndef __GNUC__