[PATCH 3/5] opengl32: Update to GL 4.5.

Matteo Bruni matteo.mystral at gmail.com
Thu Jan 15 13:33:00 CST 2015


2015-01-15 11:47 GMT+01:00 Alexandre Julliard <julliard at winehq.org>:
> Matteo Bruni <mbruni at codeweavers.com> writes:
>
>> I fixed up manually a couple of misgenerated bits, my feeling is that
>> similar fixups were done last time too.
>
> I'm not aware that fixups have ever been done by hand, that doesn't
> sound like a good idea. Please try to fix the script instead.
>

The attached patch fixes the script and now the updated files compile
fine for me without any manual intervention. I'm not attaching the
generated files to avoid getting stuck in moderation limbo again.

> --
> Alexandre Julliard
> julliard at winehq.org
>
>
-------------- next part --------------
From cbb18310a621a192177ba7a98ac1513cf06b6c2c Mon Sep 17 00:00:00 2001
From: Matteo Bruni <mbruni at codeweavers.com>
Date: Thu, 15 Jan 2015 20:00:02 +0100
Subject: [PATCH] opengl32: Fix make_opengl handling of "complex" data types.

---
 dlls/opengl32/make_opengl | 34 ++++++++++++++++++++++++----------
 1 file changed, 24 insertions(+), 10 deletions(-)

diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl
index b0b9c00..9ca5ebd 100755
--- a/dlls/opengl32/make_opengl
+++ b/dlls/opengl32/make_opengl
@@ -250,20 +250,25 @@ sub GenerateThunk($$$$)
     for (my $i = 0; $i < @{$func_ref->[1]}; $i++) {
         my $type = $func_ref->[1]->[$i]->[0];
         my $name = ConvertVarName($func_ref->[1]->[$i]->[1]);
-        $ret .= ConvertType($type) . " $name";
+        my ($base_type, $type_specifier, $name_specifier) = ($type, $type, $name);
+        if ($type =~ /(.*) (.*)/) {
+            $base_type = $2;
+        } elsif ($type =~ /(.*)(\[.*)/) {
+            $base_type = $1;
+            $type_specifier = $1;
+            $name_specifier = $name . $2
+        }
+        $ret .= ConvertType($type_specifier) . " $name_specifier";
         $call_arg .= $name;
-        if ($type =~ /\*/) {
+        if ($type =~ /\*/ || $type =~ /\[/) {
             $trace_arg .= "%p";
             $trace_call_arg .= $name;
-        } elsif (defined $debug_conv{$type}) {
-            if ($debug_conv{$type} =~ /(.*),(.*)/)
-            {
+        } elsif (defined $debug_conv{$base_type}) {
+            if ($debug_conv{$base_type} =~ /(.*),(.*)/) {
                 $trace_arg .= $1;
                 $trace_call_arg .= sprintf $2, $name;
-            }
-            else
-            {
-                $trace_arg .= $debug_conv{$type};
+            } else {
+                $trace_arg .= $debug_conv{$base_type};
                 $trace_call_arg .= $name;
             }
         }
@@ -328,7 +333,14 @@ sub generate_null_func($$)
     for (my $i = 0; $i < @{$func_ref->[1]}; $i++) {
         my $type = $func_ref->[1]->[$i]->[0];
         my $name = ConvertVarName($func_ref->[1]->[$i]->[1]);
-        $ret .= ConvertType($type) . " $name";
+        my $base_type;
+        if ($type =~ /(.*)(\[.*)/) {
+            $base_type = $1;
+            $name .= $2;
+        } else {
+            $base_type = $type;
+        }
+        $ret .= ConvertType($base_type) . " $name";
         $ret .= "," if ($i+1 < @{$func_ref->[1]});
         $ret .= " ";
     }
@@ -619,6 +631,8 @@ sub parse_variable($)
                 my @n = @{$v};
                 $pnamebefore = $n[0];
                 $pnameafter = $n[1] if (@n > 0);
+            } elsif ($v eq 'const ') {
+                $pnamebefore = $v;
             } else {
                 $pnameafter = $v;
             }
-- 
2.0.5



More information about the wine-devel mailing list