Skip to content

Commit 2a3a6f7

Browse files
somethingelseentirelyLuukdegram
authored andcommitted
fixes for Zig 0.9
1 parent 8f9a0d1 commit 2a3a6f7

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/main.zig

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ pub const Module = opaque {
100100
};
101101

102102
fn cb(params: ?*const Valtype, results: ?*Valtype) callconv(.C) ?*Trap {
103+
_ = params;
104+
_ = results;
103105
const func = @intToPtr(fn () void, CALLBACK);
104106
func();
105107
return null;
@@ -241,7 +243,7 @@ pub const Func = opaque {
241243
};
242244
}
243245

244-
extern "c" fn wasm_func_new(*Store, ?*c_void, Callback) ?*Func;
246+
extern "c" fn wasm_func_new(*Store, ?*anyopaque, Callback) ?*Func;
245247
extern "c" fn wasm_func_delete(*Func) void;
246248
extern "c" fn wasm_func_as_extern(*Func) ?*Extern;
247249
extern "c" fn wasm_func_copy(*const Func) ?*Func;
@@ -649,7 +651,7 @@ pub const ExternVec = extern struct {
649651
extern "c" fn wasm_extern_vec_delete(*ExternVec) void;
650652
};
651653

652-
pub const Valkind = extern enum(u8) {
654+
pub const Valkind = enum(u8) {
653655
i32 = 0,
654656
i64 = 1,
655657
f32 = 2,
@@ -665,14 +667,14 @@ pub const Value = extern struct {
665667
i64: i64,
666668
f32: f32,
667669
f64: f64,
668-
ref: ?*c_void,
670+
ref: ?*anyopaque,
669671
},
670672
};
671673

672674
pub const Valtype = opaque {
673675
/// Initializes a new `Valtype` based on the given `Valkind`
674-
pub fn init(kind: Valkind) *Valtype {
675-
return wasm_valtype_new(@enumToInt(kind));
676+
pub fn init(valKind: Valkind) *Valtype {
677+
return wasm_valtype_new(@enumToInt(valKind));
676678
}
677679

678680
pub fn deinit(self: *Valtype) void {
@@ -717,8 +719,8 @@ pub const ValVec = extern struct {
717719
};
718720

719721
// Func
720-
pub extern "c" fn wasm_functype_new(args: *ValtypeVec, results: *ValtypeVec) ?*c_void;
721-
pub extern "c" fn wasm_functype_delete(functype: *c_void) void;
722+
pub extern "c" fn wasm_functype_new(args: *ValtypeVec, results: *ValtypeVec) ?*anyopaque;
723+
pub extern "c" fn wasm_functype_delete(functype: *anyopaque) void;
722724

723725
pub const WasiConfig = opaque {
724726
/// Options to inherit when inherriting configs

0 commit comments

Comments
 (0)