Skip to content

Commit 0296fe7

Browse files
committed
wasi: provide wasi_unstable
just an alias of wasi_snapshot_preview1. as wasi_unstable is ancient, probably there is no point to support it today. a motivation here is to make it more convenient to test toywasm build for wapm.
1 parent 51178ea commit 0296fe7

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

lib/wasi.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3180,16 +3180,26 @@ wasi_instance_destroy(struct wasi_instance *inst)
31803180
const struct name wasi_snapshot_preview1 =
31813181
NAME_FROM_CSTR_LITERAL("wasi_snapshot_preview1");
31823182

3183-
static const struct host_module module_wasi_snapshot_preview1 = {
3184-
.module_name = &wasi_snapshot_preview1,
3185-
.funcs = wasi_funcs,
3186-
.nfuncs = ARRAYCOUNT(wasi_funcs),
3183+
static const struct name wasi_unstable =
3184+
NAME_FROM_CSTR_LITERAL("wasi_unstable");
3185+
3186+
static const struct host_module module_wasi[] = {
3187+
{
3188+
.module_name = &wasi_snapshot_preview1,
3189+
.funcs = wasi_funcs,
3190+
.nfuncs = ARRAYCOUNT(wasi_funcs),
3191+
},
3192+
{
3193+
.module_name = &wasi_unstable,
3194+
.funcs = wasi_funcs,
3195+
.nfuncs = ARRAYCOUNT(wasi_funcs),
3196+
},
31873197
};
31883198

31893199
int
31903200
import_object_create_for_wasi(struct wasi_instance *wasi,
31913201
struct import_object **impp)
31923202
{
31933203
return import_object_create_for_host_funcs(
3194-
&module_wasi_snapshot_preview1, 1, &wasi->hi, impp);
3204+
module_wasi, ARRAYCOUNT(module_wasi), &wasi->hi, impp);
31953205
}

0 commit comments

Comments
 (0)