diff options
author | James Brown | 2004-01-10 05:20:15 +0000 |
---|---|---|
committer | James Brown | 2004-01-10 05:20:15 +0000 |
commit | 1778b01d765b8290c47324d6befebb9130353973 (patch) | |
tree | 0dfb0c136410c075a4f86a8f51db5c6a9a14499c /base | |
parent | ab7db8fb045d36dfcd1d5eb709c0ccc64298512d (diff) | |
download | scummvm-rg350-1778b01d765b8290c47324d6befebb9130353973.tar.gz scummvm-rg350-1778b01d765b8290c47324d6befebb9130353973.tar.bz2 scummvm-rg350-1778b01d765b8290c47324d6befebb9130353973.zip |
Start of debug channel support. TODO: Move this to the common Debugger system?
svn-id: r12289
Diffstat (limited to 'base')
-rw-r--r-- | base/engine.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/base/engine.cpp b/base/engine.cpp index 5bb7a33fe5..7660fbcfd4 100644 --- a/base/engine.cpp +++ b/base/engine.cpp @@ -192,6 +192,33 @@ void CDECL debug(int level, const char *s, ...) { fflush(stdout); } +void CDECL debug(const char *s, ...) { +#ifdef __PALM_OS__ + char buf[256]; // 1024 is too big overflow the stack +#else + char buf[1024]; +#endif + va_list va; + + va_start(va, s); + vsprintf(buf, s, va); + va_end(va); + printf("%s\n", buf); + +#if defined( USE_WINDBG ) + strcat(buf, "\n"); +#if defined( _WIN32_WCE ) + TCHAR buf_unicode[1024]; + MultiByteToWideChar(CP_ACP, 0, buf, strlen(buf) + 1, buf_unicode, sizeof(buf_unicode)); + OutputDebugString(buf_unicode); +#else + OutputDebugString(buf); +#endif +#endif + + fflush(stdout); +} + void checkHeap() { #if defined(_MSC_VER) if (_heapchk() != _HEAPOK) { |