From 241e100827fffde710eb0722691eeee592854744 Mon Sep 17 00:00:00 2001 From: Jae B Date: Thu, 22 Feb 2024 19:03:09 +1100 Subject: [PATCH] update root.os.system override to require "system" field, this allows easier overriding of os.heap.page_allocator --- lib/std/os.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/os.zig b/lib/std/os.zig index fda2800486..6880878c45 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -59,7 +59,7 @@ test { /// Applications can override the `system` API layer in their root source file. /// Otherwise, when linking libc, this is the C API. /// When not linking libc, it is the OS-specific system interface. -pub const system = if (@hasDecl(root, "os") and root.os != @This()) +pub const system = if (@hasDecl(root, "os") and @hasDecl(root.os, "system") and root.os != @This()) root.os.system else if (use_libc) std.c