opengl32: Ensure extension tables generated by make_opengl contain earliest GL_VERSION for each function.

Sebastian Lackner sebastian at fds-team.de
Fri Feb 12 17:21:03 CST 2016


Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
---

A couple of functions (glBindBufferBase, glBindBufferRange, glGetIntegeri_v) are listed
in multiple feature levels. The current implementation of ./make_opengl does not handle
this correctly, so depending on the order of elements in the hash table, a different
GL_VERSION_* string is added to the extension registry. Spotted by accident when I noticed
that the output changes each time I regenerate OpenGL files. ;)

The good news: Luckily the hash tables were sorted "correctly" when Matteo bumped the
version the last time, so the version in the Wine source tree is fine.

If some perl experts out there know a better way to fix it, or if I'm violating any perl
style rules I'm not aware of, feel free to send an improved version. ;)

 dlls/opengl32/make_opengl |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl
index 2b15f58..ec782ed 100755
--- a/dlls/opengl32/make_opengl
+++ b/dlls/opengl32/make_opengl
@@ -692,12 +692,14 @@ sub parse_file($$)
     }
 
     # generate extension functions from norm functions, if they are newer than the category
-    while (my ($k, $v) = each(%{$data->{feature}})) {
+    my %features = %{$data->{feature}};
+    foreach (sort keys %features) {
+        my ($k, $v) = %features{$_};
         if (!$norm_categories{$k} && $v->{api} =~ /^gl(\||$)/)
         {
             for my $req (@{$v->{require}}) {
                 for (keys %{$req->{command}}) {
-                    if (!$norm_functions{$_}) {
+                    if (!$ext_functions{$_} && !$norm_functions{$_}) {
                         $ext_functions{$_} = [ $functions{$_}[0], $functions{$_}[1], [ $k ] ];
                     }
                 }
-- 
2.7.1



More information about the wine-patches mailing list