From 674092ab42e693c4d333758f6616e6b54c370a16 Mon Sep 17 00:00:00 2001 From: Arnau478 Date: Tue, 22 Aug 2023 21:37:13 +0200 Subject: [PATCH] `CALLBACK` should be casted to a pointer `CALLBACK` should be casted to a `*const fn () void` instead of `fn () void` --- src/main.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.zig b/src/main.zig index e9c8023..d693d85 100644 --- a/src/main.zig +++ b/src/main.zig @@ -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; }