Commit cac33018 authored by Alexandre Julliard's avatar Alexandre Julliard

opengl32: Make all the function pointers and thunks static.

parent 7500e0fe
...@@ -683,7 +683,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(opengl); ...@@ -683,7 +683,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(opengl);
# First, generate the function pointers # First, generate the function pointers
foreach (sort keys %ext_functions) { foreach (sort keys %ext_functions) {
my $func_ref = $ext_functions{$_}; my $func_ref = $ext_functions{$_};
print EXT ConvertType($func_ref->[1]), " (*$ext_prefix$func_ref->[0])( "; print EXT "static ", ConvertType($func_ref->[1]), " (*$ext_prefix$func_ref->[0])( ";
for (my $i = 0; $i <= $#{@{$func_ref->[2]}}; $i++) { for (my $i = 0; $i <= $#{@{$func_ref->[2]}}; $i++) {
my $type = ConvertType($func_ref->[2]->[$i]->[0]); my $type = ConvertType($func_ref->[2]->[$i]->[0]);
print EXT "$type"; print EXT "$type";
...@@ -694,32 +694,22 @@ foreach (sort keys %ext_functions) { ...@@ -694,32 +694,22 @@ foreach (sort keys %ext_functions) {
} }
} }
print EXT 'void ' if ($#{@{$func_ref->[2]}} < 0); print EXT 'void ' if ($#{@{$func_ref->[2]}} < 0);
print EXT ") = (void *) 0xdeadbeef;\n"; print EXT ");\n";
} }
# Then, the function prototypes # The thunks themselves....
print EXT "\n\n/* The function prototypes */\n"; print EXT "\n/* The thunks themselves....*/";
foreach (sort keys %ext_functions) { foreach (sort keys %ext_functions) {
my $func_ref = $ext_functions{$_}; my $string = GenerateThunk($ext_functions{$_}, 0, $ext_prefix, $gen_thread_safe);
print EXT ConvertType($func_ref->[1]), " WINAPI wine_$func_ref->[0]( ";
for (my $i = 0; $i <= $#{@{$func_ref->[2]}}; $i++) { print EXT "\nstatic $string";
my $type = ConvertType($func_ref->[2]->[$i]->[0]);
print EXT "$type";
if ($i != $#{@{$func_ref->[2]}}) {
print EXT ", ";
} else {
print EXT " ";
}
}
print EXT 'void ' if ($#{@{$func_ref->[2]}} < 0);
print EXT ");\n";
} }
# Then the table giving the string <-> function correspondance */ # Then the table giving the string <-> function correspondance */
print EXT "\n\n/* The table giving the correspondance between names and functions */\n"; print EXT "\n\n/* The table giving the correspondance between names and functions */\n";
my @tmp = keys %ext_functions; my @tmp = keys %ext_functions;
print EXT "int extension_registry_size = ", ($#tmp + 1), ";\n"; print EXT "const int extension_registry_size = ", ($#tmp + 1), ";\n";
print EXT "OpenGL_extension extension_registry[", ($#tmp + 1), "] = {\n"; print EXT "const OpenGL_extension extension_registry[", ($#tmp + 1), "] = {\n";
my $i = 0; my $i = 0;
foreach (sort keys %ext_functions) { foreach (sort keys %ext_functions) {
my $func_ref = $ext_functions{$_}; my $func_ref = $ext_functions{$_};
...@@ -732,11 +722,4 @@ foreach (sort keys %ext_functions) { ...@@ -732,11 +722,4 @@ foreach (sort keys %ext_functions) {
} }
print EXT "};\n"; print EXT "};\n";
# And, finally, the thunks themselves....
print EXT "\n/* The thunks themselves....*/";
foreach (sort keys %ext_functions) {
my $string = GenerateThunk($ext_functions{$_}, 0, $ext_prefix, $gen_thread_safe);
print EXT "\n$string";
}
close(EXT); close(EXT);
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -70,8 +70,8 @@ typedef struct { ...@@ -70,8 +70,8 @@ typedef struct {
void **func_ptr; /* where to store the value of glXGetProcAddressARB */ void **func_ptr; /* where to store the value of glXGetProcAddressARB */
} OpenGL_extension; } OpenGL_extension;
extern OpenGL_extension extension_registry[]; extern const OpenGL_extension extension_registry[];
extern int extension_registry_size; extern const int extension_registry_size;
const GLubyte* internal_glGetString(GLenum name); const GLubyte* internal_glGetString(GLenum name);
void internal_glGetIntegerv(GLenum pname, GLint* params); void internal_glGetIntegerv(GLenum pname, GLint* params);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment