mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
Merge pull request #19360 from ziglang/no-byos-posix
std: don't do BYOS at the POSIX API layer
This commit is contained in:
commit
7ecbb6f3a0
2 changed files with 4 additions and 8 deletions
|
|
@ -2264,7 +2264,7 @@ pub fn map_shadow_stack(addr: u64, size: u64, flags: u32) usize {
|
|||
}
|
||||
|
||||
pub const E = switch (native_arch) {
|
||||
.mips, .mipsel => enum(i32) {
|
||||
.mips, .mipsel => enum(u16) {
|
||||
/// No error occurred.
|
||||
SUCCESS = 0,
|
||||
|
||||
|
|
@ -2406,7 +2406,7 @@ pub const E = switch (native_arch) {
|
|||
|
||||
pub const init = errnoFromSyscall;
|
||||
},
|
||||
.sparc, .sparcel, .sparc64 => enum(i32) {
|
||||
.sparc, .sparcel, .sparc64 => enum(u16) {
|
||||
/// No error occurred.
|
||||
SUCCESS = 0,
|
||||
|
||||
|
|
|
|||
|
|
@ -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