diff options
author | Brian Paul <[email protected]> | 2010-02-19 12:56:49 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-02-19 12:56:49 -0700 |
commit | 78a0c353d0f87c85feaa6dcb3042fc25d424f21b (patch) | |
tree | ea638e071a08127708883560bdb96b8c0547d854 /src/mesa/main/imports.c | |
parent | 8de5a292f70dba854a4bf06a2210bc38381e6bcf (diff) |
mesa: restore _mesa_snprintf() - it's needed for Windows
This reverts part of commit 298be2b028263b2c343a707662c6fbfa18293cb2
Diffstat (limited to 'src/mesa/main/imports.c')
-rw-r--r-- | src/mesa/main/imports.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 112490915f7..56e8195810e 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -827,6 +827,19 @@ _mesa_str_checksum(const char *str) /*@}*/ +/** Wrapper around vsnprintf() */ +int +_mesa_snprintf( char *str, size_t size, const char *fmt, ... ) +{ + int r; + va_list args; + va_start( args, fmt ); + r = vsnprintf( str, size, fmt, args ); + va_end( args ); + return r; +} + + /**********************************************************************/ /** \name Diagnostics */ /*@{*/ @@ -866,7 +879,7 @@ output_if_debug(const char *prefixString, const char *outputString, * visible, so communicate with the debugger instead */ { char buf[4096]; - snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : ""); + _mesa_snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : ""); OutputDebugStringA(buf); } #endif @@ -915,7 +928,7 @@ flush_delayed_errors( GLcontext *ctx ) char s[MAXSTRING]; if (ctx->ErrorDebugCount) { - snprintf(s, MAXSTRING, "%d similar %s errors", + _mesa_snprintf(s, MAXSTRING, "%d similar %s errors", ctx->ErrorDebugCount, error_string(ctx->ErrorValue)); @@ -1022,7 +1035,7 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) vsnprintf(s, MAXSTRING, fmtString, args); va_end(args); - snprintf(s2, MAXSTRING, "%s in %s", error_string(error), s); + _mesa_snprintf(s2, MAXSTRING, "%s in %s", error_string(error), s); output_if_debug("Mesa: User error", s2, GL_TRUE); ctx->ErrorDebugFmtString = fmtString; |