From e41d53b1e02ce7cdb0fbad918aa737ed687f5855 Mon Sep 17 00:00:00 2001 From: Daniel Collin Date: Tue, 8 Jan 2013 23:34:35 +0100 Subject: [PATCH] Use OutputDebugString for rlog on Win32 --- ogl_editor/src/rlog.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ogl_editor/src/rlog.c b/ogl_editor/src/rlog.c index 4e1d8e0..6574278 100644 --- a/ogl_editor/src/rlog.c +++ b/ogl_editor/src/rlog.c @@ -2,6 +2,11 @@ #include #include +#if defined(WIN32) +#define WIN32_LEAN_AND_MEAN +#include +#endif + static int s_log_level = 0; static int s_old_level = 0; @@ -9,14 +14,20 @@ static int s_old_level = 0; void rlog(int logLevel, const char* format, ...) { + char buffer[2048]; va_list ap; if (logLevel < s_log_level) return; va_start(ap, format); - vprintf(format, ap); - va_end(ap); +#if defined(_WIN32) + vsprintf(buffer, format, ap); + OutputDebugStringA(buffer); +#else + vprintf(format, ap); +#endif + va_end(ap); } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////