projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a7d3507
)
glsl: Fix printf_length() on MSVC.
author
José Fonseca
<jfonseca@vmware.com>
Tue, 1 Feb 2011 10:41:46 +0000
(10:41 +0000)
committer
José Fonseca
<jfonseca@vmware.com>
Tue, 1 Feb 2011 10:41:46 +0000
(10:41 +0000)
src/glsl/ralloc.c
patch
|
blob
|
history
diff --git
a/src/glsl/ralloc.c
b/src/glsl/ralloc.c
index fa2dd8b01e66ae9d4792133054236e9a2184ae53..3ba5d86cd9c353fc70b7f19c8758bb9d7b9091e3 100644
(file)
--- a/
src/glsl/ralloc.c
+++ b/
src/glsl/ralloc.c
@@
-392,7
+392,15
@@
printf_length(const char *fmt, va_list untouched_args)
va_list args;
va_copy(args, untouched_args);
+#ifdef _MSC_VER
+ /* We need to use _vcsprintf to calculate the size as vsnprintf returns -1
+ * if the number of characters to write is greater than count.
+ */
+ size = _vscprintf(fmt, args);
+ (void)junk;
+#else
size = vsnprintf(&junk, 1, fmt, args);
+#endif
assert(size >= 0);
return size;