| ... | @@ -39,12 +39,8 @@ const linux = std.os.linux; | ... | @@ -39,12 +39,8 @@ const linux = std.os.linux; |
| 39 | const windows = std.os.windows; | 39 | const windows = std.os.windows; |
| 40 | const wasi = std.os.wasi; | 40 | const wasi = std.os.wasi; |
| 41 | | 41 | |
| 42 | /// Applications can override the `system` API layer in their root source file. | 42 | /// A libc-compatible API layer. |
| 43 | /// Otherwise, when linking libc, this is the C API. | 43 | pub const system = if (use_libc) |
| 44 | /// When not linking libc, it is the OS-specific system interface. | | |
| 45 | pub const system = if (@hasDecl(root, "os") and @hasDecl(root.os, "system") and root.os != @This()) | | |
| 46 | root.os.system | | |
| 47 | else if (use_libc) | | |
| 48 | std.c | 44 | std.c |
| 49 | else switch (native_os) { | 45 | else switch (native_os) { |
| 50 | .linux => linux, | 46 | .linux => linux, |