Files
tinygo/src/runtime/runtime_wasm_unknown.go
T
Ayke van Laethem ceb7891986 wasm: correctly return from run() in wasm_exec.js
Instead of hanging forever, it should return the exit code from os.Exit.
2024-11-08 11:55:38 +01:00

42 lines
850 B
Go

//go:build wasm_unknown
package runtime
// TODO: this is essentially reactor mode wasm. So we might want to support
// -buildmode=c-shared (and default to it).
type timeUnit int64
// libc constructors
//
//export __wasm_call_ctors
func __wasm_call_ctors()
func init() {
__wasm_call_ctors()
}
func ticksToNanoseconds(ticks timeUnit) int64 {
return int64(ticks)
}
func nanosecondsToTicks(ns int64) timeUnit {
return timeUnit(ns)
}
// with the wasm32-unknown-unknown target there is no way to determine any `precision`
const timePrecisionNanoseconds = 1000
func sleepTicks(d timeUnit) {
}
func ticks() timeUnit {
return timeUnit(0)
}
func mainReturnExit() {
// Don't exit explicitly here. We can't (there is no environment with an
// exit call) but also it's not needed. We can just let _start and main.main
// return to the caller.
}