diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2025-08-08 13:29:49 +0100 |
|---|---|---|
| committer | gingerBill <gingerBill@users.noreply.github.com> | 2025-08-08 13:29:49 +0100 |
| commit | 804984ed35faceee3e7629dff0c8d9df86db3d98 (patch) | |
| tree | 7c3ff702b4fc0ce739e1f7cbb3bf7768da53a0cd | |
| parent | 7c93a5ae802b5a17aff6fea7368f9b27deed6517 (diff) | |
`contextless` fixes for `js`
| -rw-r--r-- | base/runtime/procs_js.odin | 4 | ||||
| -rw-r--r-- | vendor/libc/libc.odin | 4 | ||||
| -rw-r--r-- | vendor/libc/stdlib.odin | 2 | ||||
| -rw-r--r-- | vendor/wgpu/wgpu_js.odin | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/base/runtime/procs_js.odin b/base/runtime/procs_js.odin index 58bed808d..3690f9436 100644 --- a/base/runtime/procs_js.odin +++ b/base/runtime/procs_js.odin @@ -3,8 +3,8 @@ package runtime init_default_context_for_js: Context @(init, private="file") -init_default_context :: proc() { - init_default_context_for_js = context +init_default_context :: proc "contextless" () { + __init_context(&init_default_context_for_js) } @(export) diff --git a/vendor/libc/libc.odin b/vendor/libc/libc.odin index 00d687109..3ec25aacf 100644 --- a/vendor/libc/libc.odin +++ b/vendor/libc/libc.odin @@ -10,8 +10,8 @@ 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() // 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/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() } |