From fa94f1f075dd7e59a8821e87972a9d32431172a5 Mon Sep 17 00:00:00 2001
From: Aras Pranckevicius <aras@unity3d.com>
Date: Mon, 9 Aug 2010 11:17:32 +0300
Subject: [PATCH] glsl2: do not use __retval name; two underscores is reserved word according to GLSL spec (and Win7 ATI drivers do complain about that)

---
 src/glsl/glsl_types.cpp           |    8 ++++----
 src/glsl/ir_function_inlining.cpp |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp
index 03f8460..9b1bef6 100644
--- a/src/glsl/glsl_types.cpp
+++ b/src/glsl/glsl_types.cpp
@@ -267,11 +267,11 @@ glsl_type::generate_constructor(glsl_symbol_table *symtab) const
    }
 
    /* Generate the body of the constructor.  The body assigns each of the
-    * parameters to a portion of a local variable called __retval that has
-    * the same type as the constructor.  After initializing __retval,
-    * __retval is returned.
+    * parameters to a portion of a local variable called _ret_val that has
+    * the same type as the constructor.  After initializing _ret_val,
+    * _ret_val is returned.
     */
-   ir_variable *retval = new(ctx) ir_variable(this, "__retval", ir_var_auto);
+   ir_variable *retval = new(ctx) ir_variable(this, "_ret_val", ir_var_auto);
    sig->body.push_tail(retval);
 
    for (unsigned i = 0; i < length; i++) {
diff --git a/src/glsl/ir_function_inlining.cpp b/src/glsl/ir_function_inlining.cpp
index 3a87f3e..6b736f9 100644
--- a/src/glsl/ir_function_inlining.cpp
+++ b/src/glsl/ir_function_inlining.cpp
@@ -178,7 +178,7 @@ ir_call::generate_inline(ir_instruction *next_ir, ir_function_signature* parent)
 
    /* Generate storage for the return value. */
    if (this->callee->return_type) {
-      retval = new(ctx) ir_variable(this->callee->return_type, "__retval",
+      retval = new(ctx) ir_variable(this->callee->return_type, "_ret_val",
 				    ir_var_auto);
       next_ir->insert_before(retval);
    }
-- 
1.7.0.2.msysgit.0

