- debugprintf

This commit is contained in:
Christoph Oelckers 2019-11-20 20:07:33 +01:00
parent 6d40c9202c
commit caa450dcb9
2 changed files with 19 additions and 0 deletions

View file

@ -2061,3 +2061,20 @@ int32_t handleevents(void)
}
auto vsnprintfptr = vsnprintf; // This is an inline in Visual Studio but we need an address for it to satisfy the MinGW compiled libraries.
//
// debugprintf() -- sends a debug string to the debugger
//
void debugprintf(const char* f, ...)
{
va_list va;
char buf[1024];
if (!IsDebuggerPresent()) return;
va_start(va, f);
Bvsnprintf(buf, 1024, f, va);
va_end(va);
OutputDebugStringA(buf);
}

View file

@ -69,3 +69,5 @@ inline void buildputs(const char *s)
{
PrintString(PRINT_HIGH, s);
}
void debugprintf(const char* f, ...); // Prints to the debugger's log.