diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/std/wasm.zig | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/std/wasm.zig b/lib/std/wasm.zig index aa087c89c9..c59117d65b 100644 --- a/lib/std/wasm.zig +++ b/lib/std/wasm.zig @@ -253,6 +253,20 @@ pub fn section(val: Section) u8 { return @enumToInt(val); } +/// The kind of the type when importing or exporting to/from the host environment +/// https://webassembly.github.io/spec/core/syntax/modules.html +pub const ExternalKind = enum(u8) { + function, + table, + memory, + global, +}; + +/// Returns the integer value of a given `ExternalKind` +pub fn kind(val: ExternalKind) u8 { + return @enumToInt(val); +} + // types pub const element_type: u8 = 0x70; pub const function_type: u8 = 0x60; |
