mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-30 15:31:59 +00:00
Added new debugN() function which doesn't append newline.
svn-id: r20285
This commit is contained in:
parent
011d75621d
commit
052a42f89f
@ -489,12 +489,14 @@ extern "C" int main(int argc, char *argv[]) {
|
||||
END_OF_MAIN();
|
||||
#endif
|
||||
|
||||
static void debugHelper(char *buf) {
|
||||
static void debugHelper(char *buf, bool caret = true) {
|
||||
#ifndef _WIN32_WCE
|
||||
if (caret)
|
||||
printf("%s\n", buf);
|
||||
#endif
|
||||
|
||||
#if defined( USE_WINDBG )
|
||||
if (caret)
|
||||
strcat(buf, "\n");
|
||||
#if defined( _WIN32_WCE )
|
||||
TCHAR buf_unicode[1024];
|
||||
@ -522,6 +524,20 @@ void CDECL debug(int level, const char *s, ...) {
|
||||
debugHelper(buf);
|
||||
}
|
||||
|
||||
void CDECL debugN(int level, const char *s, ...) {
|
||||
char buf[STRINGBUFLEN];
|
||||
va_list va;
|
||||
|
||||
if (level > gDebugLevel)
|
||||
return;
|
||||
|
||||
va_start(va, s);
|
||||
vsnprintf(buf, STRINGBUFLEN, s, va);
|
||||
va_end(va);
|
||||
|
||||
debugHelper(buf, false);
|
||||
}
|
||||
|
||||
void CDECL debug(const char *s, ...) {
|
||||
char buf[STRINGBUFLEN];
|
||||
va_list va;
|
||||
|
@ -209,6 +209,7 @@ void CDECL warning(const char *s, ...);
|
||||
|
||||
void CDECL debug(int level, const char *s, ...);
|
||||
void CDECL debug(const char *s, ...);
|
||||
void CDECL debugN(int level, const char *s, ...);
|
||||
void checkHeap();
|
||||
|
||||
extern int gDebugLevel;
|
||||
|
Loading…
x
Reference in New Issue
Block a user