wasm: Add temporary stage2 entrypoint for wasm

This commit is contained in:
Luuk de Gram 2021-11-22 21:16:55 +01:00
parent aa61e03f24
commit 90d8544d40
No known key found for this signature in database
GPG Key ID: A8CFE58E4DC7D664

View File

@ -30,6 +30,8 @@ comptime {
}
} else if (builtin.os.tag == .windows) {
@export(wWinMainCRTStartup2, .{ .name = "wWinMainCRTStartup" });
} else if (builtin.os.tag == .wasi) {
@export(wasmMain2, .{ .name = "_start" });
} else {
if (!@hasDecl(root, "_start")) {
@export(_start2, .{ .name = "_start" });
@ -98,6 +100,11 @@ fn callMain2() noreturn {
exit2(0);
}
fn wasmMain2() u8 {
root.main();
return 0;
}
fn wWinMainCRTStartup2() callconv(.C) noreturn {
root.main();
exit2(0);