aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-02-02 07:11:28 +0000
committermarha <marha@users.sourceforge.net>2011-02-02 07:11:28 +0000
commit8e1cecd86d73502ab7c8ac2d2567bc9c15e27ad6 (patch)
treeb2bf96452d2c9353970cf14d45ef02a0fbaea59a /mesalib/src/glsl
parentd1cb96c4a8bac3c220e08a4b60aab8c4e8b6f38d (diff)
parent60107fb2d201703dba061622101dafc139559bca (diff)
downloadvcxsrv-8e1cecd86d73502ab7c8ac2d2567bc9c15e27ad6.tar.gz
vcxsrv-8e1cecd86d73502ab7c8ac2d2567bc9c15e27ad6.tar.bz2
vcxsrv-8e1cecd86d73502ab7c8ac2d2567bc9c15e27ad6.zip
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/glsl')
-rw-r--r--mesalib/src/glsl/glsl_parser_extras.cpp2
-rw-r--r--mesalib/src/glsl/ralloc.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/mesalib/src/glsl/glsl_parser_extras.cpp b/mesalib/src/glsl/glsl_parser_extras.cpp
index 2ed8b843a..1fa209c03 100644
--- a/mesalib/src/glsl/glsl_parser_extras.cpp
+++ b/mesalib/src/glsl/glsl_parser_extras.cpp
@@ -97,7 +97,7 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *ctx,
? 100 : 110;
const unsigned highest_version =
(ctx->API == API_OPENGL) ? ctx->Const.GLSLVersion : 100;
- char *supported = (char *) ralloc_context(this);
+ char *supported = ralloc_strdup(this, "");
for (unsigned ver = lowest_version; ver <= highest_version; ver += 10) {
const char *const prefix = (ver == lowest_version)
diff --git a/mesalib/src/glsl/ralloc.c b/mesalib/src/glsl/ralloc.c
index fa2dd8b01..3ba5d86cd 100644
--- a/mesalib/src/glsl/ralloc.c
+++ b/mesalib/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;