summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@tungstengraphics.com>2008-04-02 10:21:24 +0900
committerJosé Fonseca <jrfonseca@tungstengraphics.com>2008-04-05 13:45:40 +0900
commitc1d26d3dccafed808349c47dc12b94081f956560 (patch)
tree9512454baa4f46f20f9d9c85ba8cd6a8f9434a14
parentbc029247d9d886f4546a4c3a36737d09c488b7f9 (diff)
gallium: Use the custom snprintf implementation everywhere (for Win32).
Because winddk's implemenation does not handle floats.
-rw-r--r--src/gallium/auxiliary/util/p_debug.c11
-rw-r--r--src/gallium/include/pipe/p_util.h9
2 files changed, 12 insertions, 8 deletions
diff --git a/src/gallium/auxiliary/util/p_debug.c b/src/gallium/auxiliary/util/p_debug.c
index 5447bbb6f5..090e3b7794 100644
--- a/src/gallium/auxiliary/util/p_debug.c
+++ b/src/gallium/auxiliary/util/p_debug.c
@@ -43,18 +43,13 @@
#ifdef WIN32
static INLINE void
-rpl_EngDebugPrint(const char *format, ...)
+_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);
-int rpl_snprintf(char *str, size_t size, const char *format, ...);
-#define vsnprintf rpl_vsnprintf
-#define snprintf rpl_snprintf
#endif
@@ -65,8 +60,8 @@ void _debug_vprintf(const char *format, va_list 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);
+ vsnprintf(buf, sizeof(buf), format, ap);
+ _EngDebugPrint("%s", buf);
#else
/* TODO: Implement debug print for WINCE */
#endif
diff --git a/src/gallium/include/pipe/p_util.h b/src/gallium/include/pipe/p_util.h
index 1e7b8181f9..8e3aaee496 100644
--- a/src/gallium/include/pipe/p_util.h
+++ b/src/gallium/include/pipe/p_util.h
@@ -32,6 +32,7 @@
#include "p_debug.h"
#include "p_pointer.h"
#include <math.h>
+#include <stdarg.h>
#ifdef __cplusplus
@@ -137,6 +138,14 @@ REALLOC( void *old_ptr, unsigned old_size, unsigned new_size )
#define GETENV( X ) debug_get_option( X, NULL )
+#ifdef WIN32
+int rpl_vsnprintf(char *, size_t, const char *, va_list);
+int rpl_snprintf(char *str, size_t size, const char *format, ...);
+#define vsnprintf rpl_vsnprintf
+#define snprintf rpl_snprintf
+#endif
+
+
/**
* Return memory on given byte alignment
*/