gallium: Don't assume snprintf are always available.

This commit is contained in:
José Fonseca
2008-04-14 23:55:36 +09:00
parent 21ae3d2721
commit 5b8fa51847
9 changed files with 88 additions and 28 deletions

View File

@@ -39,6 +39,7 @@
#include "pipe/p_compiler.h"
#include "pipe/p_util.h"
#include "pipe/p_debug.h"
#include "util/u_string.h"
#ifdef WIN32
@@ -60,7 +61,7 @@ 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];
vsnprintf(buf, sizeof(buf), format, ap);
util_vsnprintf(buf, sizeof(buf), format, ap);
_EngDebugPrint("%s", buf);
#else
/* TODO: Implement debug print for WINCE */
@@ -311,7 +312,7 @@ debug_dump_enum(const struct debug_named_value *names,
++names;
}
snprintf(rest, sizeof(rest), "0x%08lx", value);
util_snprintf(rest, sizeof(rest), "0x%08lx", value);
return rest;
}
@@ -344,7 +345,7 @@ debug_dump_flags(const struct debug_named_value *names,
else
first = 0;
snprintf(rest, sizeof(rest), "0x%08lx", value);
util_snprintf(rest, sizeof(rest), "0x%08lx", value);
strncat(output, rest, sizeof(output));
}