mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-08 22:13:17 +00:00
Define wasm _start entry point in Odin code
This commit is contained in:
19
core/runtime/entry_wasm.odin
Normal file
19
core/runtime/entry_wasm.odin
Normal file
@@ -0,0 +1,19 @@
|
||||
//+private
|
||||
//+build wasm32, wasm64
|
||||
package runtime
|
||||
|
||||
import "core:intrinsics"
|
||||
|
||||
when !ODIN_TEST && !ODIN_NO_ENTRY_POINT {
|
||||
@(link_name="_start", linkage="strong", require, export)
|
||||
_start :: proc "c" () {
|
||||
context = default_context()
|
||||
#force_no_inline _startup_runtime()
|
||||
intrinsics.__entry_point()
|
||||
}
|
||||
@(link_name="_end", linkage="strong", require, export)
|
||||
_end :: proc "c" () {
|
||||
context = default_context()
|
||||
#force_no_inline _cleanup_runtime()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user