mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
std: don't do BYOS at the POSIX API layer
This was a mistake from day one. This is the wrong abstraction layer to do this in. My alternate plan for this is to make all I/O operations require an IO interface parameter, similar to how allocations require an Allocator interface parameter today.
This commit is contained in:
parent
5d389535e8
commit
cba1555104
1 changed files with 2 additions and 6 deletions
|
|
@ -39,12 +39,8 @@ const linux = std.os.linux;
|
|||
const windows = std.os.windows;
|
||||
const wasi = std.os.wasi;
|
||||
|
||||
/// 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 @hasDecl(root.os, "system") and root.os != @This())
|
||||
root.os.system
|
||||
else if (use_libc)
|
||||
/// A libc-compatible API layer.
|
||||
pub const system = if (use_libc)
|
||||
std.c
|
||||
else switch (native_os) {
|
||||
.linux => linux,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue