From b6a4f126d7c1298d81df30a28f6f339d559457c2 Mon Sep 17 00:00:00 2001 From: staphen Date: Sun, 19 Dec 2021 23:28:27 -0500 Subject: [PATCH] Modify the Windows implementation of printInConsole() to call OutputDebugString() --- Source/utils/console.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Source/utils/console.cpp b/Source/utils/console.cpp index 62ead8dfd..9bff83336 100644 --- a/Source/utils/console.cpp +++ b/Source/utils/console.cpp @@ -28,28 +28,27 @@ HANDLE GetStderrHandle() void printInConsole(const char *fmt, ...) { - HANDLE handle = GetStderrHandle(); - if (handle == NULL) - return; - char message[4096]; va_list ap; va_start(ap, fmt); std::vsnprintf(message, sizeof(message), fmt, ap); va_end(ap); - WriteConsole(handle, message, strlen(message), NULL, NULL); -} + OutputDebugString(message); -void printInConsoleV(const char *fmt, va_list ap) -{ HANDLE handle = GetStderrHandle(); if (handle == NULL) return; + WriteConsole(handle, message, strlen(message), NULL, NULL); +} +void printInConsoleV(const char *fmt, va_list ap) +{ char message[4096]; std::vsnprintf(message, sizeof(message), fmt, ap); + OutputDebugString(message); + HANDLE handle = GetStderrHandle(); if (handle == NULL) return; WriteConsole(handle, message, strlen(message), NULL, NULL);