Skip to content

Commit

Permalink
CALLBACK should be casted to a pointer
Browse files Browse the repository at this point in the history
`CALLBACK` should be casted to a `*const fn () void` instead of `fn ()
void`
  • Loading branch information
Arnau478 committed Aug 22, 2023
1 parent 9db4d80 commit 674092a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pub const Module = opaque {
fn cb(params: ?*const Valtype, results: ?*Valtype) callconv(.C) ?*Trap {
_ = params;
_ = results;
const func = @as(fn () void, @ptrFromInt(CALLBACK));
const func = @as(*const fn () void, @ptrFromInt(CALLBACK));
func();
return null;
}
Expand Down

0 comments on commit 674092a

Please sign in to comment.