Commit 241e100827

Jae B <doogie1012@gmail.com>
2024-02-22 09:03:09
update root.os.system override to require "system" field, this allows easier overriding of os.heap.page_allocator
1 parent dd1fc1c
Changed files (1)
lib
std
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