don't use macros with variable number of arguments - no version of VC supports it

use existing WARN macro which falls back to printf if LOG isn't yet constructed
This commit is contained in:
Chris Danford
2007-04-24 05:24:14 +00:00
parent 44437edc12
commit 79fd5b35fd
7 changed files with 44 additions and 50 deletions
+7 -4
View File
@@ -413,19 +413,22 @@ void RageLog::UnmapLog( const RString &key )
UpdateMappedLog();
}
void ShowWarning( const char *file, int line, const char *message )
void ShowWarningOrTrace( const char *file, int line, const char *message, bool bWarning )
{
/* Ignore everything up to and including the first "src/". */
const char *temp = strstr( file, "src/" );
if( temp )
file = temp + 4;
if( LOG != NULL )
LOG->Warn( "%s:%i: %s", file, line, message );
void (RageLog::*method)(const char *fmt, ...) = bWarning ? RageLog::Warn : RageLog::Trace;
if( LOG )
(LOG->*method)( "%s:%i: %s", file, line, message );
else
fprintf( stderr, "%s:%i: %s", file, line, message );
}
/*
* Copyright (c) 2001-2004 Chris Danford, Glenn Maynard
* All rights reserved.