diff options
author | José Fonseca <jose.r.fonseca@gmail.com> | 2011-11-01 06:58:29 +0000 |
---|---|---|
committer | José Fonseca <jose.r.fonseca@gmail.com> | 2011-11-01 08:47:39 +0000 |
commit | 7f08248c2e2d7e862e88db2d0008efca3c276512 (patch) | |
tree | c5fe87599e184c8602a0aa418870cd370c8bf6f0 /src/glsl/ralloc.c | |
parent | e33447aac62da5e7fe8f6a262cacaa97ce212ef5 (diff) |
ralloc: Use _vscprintf on MinGW.
MinGW uses MSVC's runtime DLLs for most of C runtime's functions, and
there has same semantics for vsnprintf.
Not sure how this worked until now -- maybe one of the internal
vsnprintf implementations was taking precedence.
Diffstat (limited to 'src/glsl/ralloc.c')
-rw-r--r-- | src/glsl/ralloc.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/glsl/ralloc.c b/src/glsl/ralloc.c index f5f3934ac2c..91e4bab2ebd 100644 --- a/src/glsl/ralloc.c +++ b/src/glsl/ralloc.c @@ -33,6 +33,12 @@ #include <limits.h> #endif +/* Some versions of MinGW are missing _vscprintf's declaration, although they + * still provide the symbol in the import library. */ +#ifdef __MINGW32__ +_CRTIMP int _vscprintf(const char *format, va_list argptr); +#endif + #include "ralloc.h" #ifdef __GNUC__ @@ -397,7 +403,7 @@ printf_length(const char *fmt, va_list untouched_args) va_list args; va_copy(args, untouched_args); -#ifdef _MSC_VER +#ifdef _WIN32 /* We need to use _vcsprintf to calculate the size as vsnprintf returns -1 * if the number of characters to write is greater than count. */ |