Browse Source

Correct `-init` for *nix to be a different procedure

gingerBill 3 years ago
parent
commit
75b7f2b9fe
1 changed files with 18 additions and 0 deletions
  1. 18 0
      core/runtime/proc_unix.odin

+ 18 - 0
core/runtime/proc_unix.odin

@@ -0,0 +1,18 @@
+//+private
+//+build linux, darwin
+package runtime
+
+import "core:intrinsics"
+
+when ODIN_BUILD_MODE == "dynamic" {
+	@(link_name="_odin_entry_point", linkage="strong", require)
+	_odin_entry_point :: proc "c" () {
+		context = default_context()
+		#force_no_inline _startup_runtime()
+	}
+	@(link_name="_odin_exit_point", linkage="strong", require)
+	_odin_exit_point :: proc "c" () {
+		context = default_context()
+		#force_no_inline _cleanup_runtime()
+	}
+}