aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorJae B <doogie1012@gmail.com>2024-02-22 19:03:09 +1100
committerVeikka Tuominen <git@vexu.eu>2024-02-22 21:33:58 +0200
commit241e100827fffde710eb0722691eeee592854744 (patch)
tree1be686c7673ce511c2dba2bad4c740f6390a7e40 /lib/std
parentdd1fc1cb8c2258256566fd0035deb6fbf700fc69 (diff)
downloadzig-241e100827fffde710eb0722691eeee592854744.tar.gz
zig-241e100827fffde710eb0722691eeee592854744.zip
update root.os.system override to require "system" field, this allows easier overriding of os.heap.page_allocator
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/os.zig2
1 files changed, 1 insertions, 1 deletions
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