summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util/p_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/util/p_debug.c')
-rw-r--r--src/gallium/auxiliary/util/p_debug.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/util/p_debug.c b/src/gallium/auxiliary/util/p_debug.c
index 0da3b66a4d..7b3c030956 100644
--- a/src/gallium/auxiliary/util/p_debug.c
+++ b/src/gallium/auxiliary/util/p_debug.c
@@ -40,10 +40,28 @@
#include "pipe/p_compiler.h"
+#ifdef WIN32
+static INLINE void
+rpl_EngDebugPrint(const char *format, ...)
+{
+ va_list ap;
+ va_start(ap, format);
+ EngDebugPrint("", (PCHAR)format, ap);
+ va_end(ap);
+}
+
+int rpl_vsnprintf(char *, size_t, const char *, va_list);
+#endif
+
+
void debug_vprintf(const char *format, va_list ap)
{
#ifdef WIN32
- EngDebugPrint("", (PCHAR)format, ap);
+ /* EngDebugPrint does not handle float point arguments, so we need to use
+ * our own vsnprintf implementation */
+ char buf[512 + 1];
+ rpl_vsnprintf(buf, sizeof(buf), format, ap);
+ rpl_EngDebugPrint("%s", buf);
#else
vfprintf(stderr, format, ap);
#endif