mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 07:10:09 +01:00
gallium: Use custom vsnprintf in WINDDK.
EngDebugPrint does not handle float point arguments, so we need to use our own vsnprintf implementation.
This commit is contained in:
parent
5aa108214a
commit
b1922de9f3
3 changed files with 1502 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ util = env.ConvenienceLibrary(
|
|||
'p_tile.c',
|
||||
'p_util.c',
|
||||
'u_mm.c',
|
||||
'u_snprintf.c',
|
||||
])
|
||||
|
||||
auxiliaries.insert(0, util)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
1482
src/gallium/auxiliary/util/u_snprintf.c
Normal file
1482
src/gallium/auxiliary/util/u_snprintf.c
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue