Closed mohamedmoussa89 closed 2 years ago
Please see https://github.com/ziglang/zig/wiki/Self-Hosted-Compiler-Upgrade-Guide#function-pointers
In summary function pointers change from fn (...) to *const fn()
fn (...)
*const fn()
const function_pointers = struct { var glTexStorage2D: ?*const function_signatures.glTexStorage2D = null;
In the load function I've also switched to @TypeOf although this is not critical
load
@TypeOf
if(get_proc_address(load_ctx, "glTexStorage2D")) |proc| { function_pointers.glTexStorage2D = @ptrCast(@TypeOf(function_pointers.glTexStorage2D), proc);
I have tested this by generating and using bindings for 4.6.
Please see https://github.com/ziglang/zig/wiki/Self-Hosted-Compiler-Upgrade-Guide#function-pointers
In summary function pointers change from
fn (...)
to*const fn()
In the
load
function I've also switched to@TypeOf
although this is not criticalI have tested this by generating and using bindings for 4.6.