fixed: #58 by adding `_initialize` export
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Sun, 10 Dec 2023 04:08:28 +0000 (22:08 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Sun, 10 Dec 2023 04:08:28 +0000 (22:08 -0600)
core/runtime/common.onyx

index 498fdb9ad4137fc0dbb84ad6673fae51b90b4102..471b0a38fb98b7a80d033a78fb4a87f010db90dd 100644 (file)
@@ -9,6 +9,14 @@ use runtime.platform { __output_string }
 // Every platform should define this, even if is it just '() {}'.
 #export "_start" platform.__start
 
+//
+// Export a common initialization procedure that should
+// always be invoked before using anything in Onyx.
+#export "_initialize" () {
+    __runtime_initialize();
+    context.thread_id = 0;    
+}
+
 #local
 __output_uint :: (n: u64) {
     buf: [128] u8;