diff options
author | José Fonseca <[email protected]> | 2009-01-07 12:02:06 +0000 |
---|---|---|
committer | José Fonseca <[email protected]> | 2009-01-07 12:02:06 +0000 |
commit | f8f9a1b620d31d1a59855fd502caed325d4a324f (patch) | |
tree | bf258221c76d62ee9edc169646f5c0d97d287f18 /src/mesa/main | |
parent | a055520bfba38b160a79f41a6c9df377150e0a10 (diff) |
mesa: Add _mesa_snprintf.
On Windows snprintf is renamed as _snprintf.
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/imports.c | 12 | ||||
-rw-r--r-- | src/mesa/main/imports.h | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 7231fa699cb..27d6df2f85a 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -909,6 +909,18 @@ _mesa_sprintf( char *str, const char *fmt, ... ) return r; } +/** 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; +} + /** Wrapper around printf(), using vsprintf() for the formatting. */ void _mesa_printf( const char *fmtString, ... ) diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index d91a1366b07..52d679cadd7 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -752,6 +752,9 @@ _mesa_strtod( const char *s, char **end ); extern int _mesa_sprintf( char *str, const char *fmt, ... ); +extern int +_mesa_snprintf( char *str, size_t size, const char *fmt, ... ); + extern void _mesa_printf( const char *fmtString, ... ); |