aboutsummaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-08-10 12:47:15 +0100
committerGitHub <noreply@github.com>2025-08-10 12:47:15 +0100
commita0ff05e63307f533b384820717bb582e1ff47c39 (patch)
treed9adfd28090dc72044003fed211383a63bdb3587 /vendor
parentdbc338248e8693994f232d02f1aff9536f204add (diff)
parent14ca1c8c89dd219dd52d061649d4db7778df2e64 (diff)
Merge pull request #5558 from odin-lang/bill/init-fini-changes
`@(init)` & `@(finit)` Changes.
Diffstat (limited to 'vendor')
-rw-r--r--vendor/libc/libc.odin5
-rw-r--r--vendor/libc/stdlib.odin2
-rw-r--r--vendor/miniaudio/common.odin4
-rw-r--r--vendor/wgpu/wgpu_js.odin2
4 files changed, 7 insertions, 6 deletions
diff --git a/vendor/libc/libc.odin b/vendor/libc/libc.odin
index 00d687109..a5508e14f 100644
--- a/vendor/libc/libc.odin
+++ b/vendor/libc/libc.odin
@@ -10,8 +10,9 @@ g_ctx: runtime.Context
g_allocator: mem.Compat_Allocator
@(init)
-init_context :: proc() {
- g_ctx = context
+init_context :: proc "contextless" () {
+ g_ctx = runtime.default_context()
+ context = g_ctx
// Wrapping the allocator with the mem.Compat_Allocator so we can
// mimic the realloc semantics.
diff --git a/vendor/libc/stdlib.odin b/vendor/libc/stdlib.odin
index 9f578a436..bb9233a28 100644
--- a/vendor/libc/stdlib.odin
+++ b/vendor/libc/stdlib.odin
@@ -169,7 +169,7 @@ exit :: proc "c" (exit_code: c.int) -> ! {
}
@(private, fini)
-finish_atexit :: proc "c" () {
+finish_atexit :: proc "contextless" () {
n := intrinsics.atomic_exchange(&atexit_functions_count, 0)
for function in atexit_functions[:n] {
function()
diff --git a/vendor/miniaudio/common.odin b/vendor/miniaudio/common.odin
index 0263278bc..e675cb7f6 100644
--- a/vendor/miniaudio/common.odin
+++ b/vendor/miniaudio/common.odin
@@ -25,7 +25,7 @@ BINDINGS_VERSION :: [3]u32{BINDINGS_VERSION_MAJOR, BINDINGS_VERSION_MIN
BINDINGS_VERSION_STRING :: "0.11.22"
@(init)
-version_check :: proc() {
+version_check :: proc "contextless" () {
v: [3]u32
version(&v.x, &v.y, &v.z)
if v != BINDINGS_VERSION {
@@ -43,7 +43,7 @@ version_check :: proc() {
n += copy(buf[n:], "and executing `make`")
}
- panic(string(buf[:n]))
+ panic_contextless(string(buf[:n]))
}
}
diff --git a/vendor/wgpu/wgpu_js.odin b/vendor/wgpu/wgpu_js.odin
index 3c8375adb..3217a97dc 100644
--- a/vendor/wgpu/wgpu_js.odin
+++ b/vendor/wgpu/wgpu_js.odin
@@ -5,7 +5,7 @@ import "base:runtime"
g_context: runtime.Context
@(private="file", init)
-wgpu_init_allocator :: proc() {
+wgpu_init_allocator :: proc "contextless" () {
if g_context.allocator.procedure == nil {
g_context = runtime.default_context()
}