|
|
@ -90,10 +90,10 @@ pub const Instance = extern struct { |
|
|
|
comptime T: type, |
|
|
|
comptime T: type, |
|
|
|
) !struct { result: T, name: []const u8 } { |
|
|
|
) !struct { result: T, name: []const u8 } { |
|
|
|
var result: Extern = undefined; |
|
|
|
var result: Extern = undefined; |
|
|
|
var name: [*]const u8 = null; |
|
|
|
var name: [*]const u8 = undefined; |
|
|
|
var name_len: usize = undefined; |
|
|
|
var name_len: usize = undefined; |
|
|
|
return if (wasmtime_instance_export_nth(context, self, index, &name, &name_len, &result)) |
|
|
|
return if (wasmtime_instance_export_nth(context, self, index, &name, &name_len, &result)) |
|
|
|
.{ .result = result.as(T), .name = name[0..name_len] } |
|
|
|
.{ .result = try result.as(T), .name = name[0..name_len] } |
|
|
|
else |
|
|
|
else |
|
|
|
error.ExportNotFound; |
|
|
|
error.ExportNotFound; |
|
|
|
} |
|
|
|
} |
|
|
|