commit 2f260256903a5130e879ab7dc020fa160befc4d9 (tree)
parent 00a3123fbe79d9bb74b2c877130579299d2ba5ba
Author: Andrew Kelley <andrew@ziglang.org>
Date: Tue, 21 Oct 2025 14:12:28 -0700
std: fix build failure on wasm32-freestanding
Diffstat:
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/lib/std/fs/File.zig b/lib/std/fs/File.zig
@@ -32,11 +32,7 @@ pub const Kind = Io.File.Kind;
/// the `touch` command, which would correspond to `0o644`. However, POSIX
/// libc implementations use `0o666` inside `fopen` and then rely on the
/// process-scoped "umask" setting to adjust this number for file creation.
-pub const default_mode = switch (builtin.os.tag) {
- .windows => 0,
- .wasi => 0,
- else => 0o666,
-};
+pub const default_mode: Mode = if (Mode == u0) 0 else 0o666;
/// Deprecated in favor of `Io.File.OpenError`.
pub const OpenError = Io.File.OpenError || error{WouldBlock};
diff --git a/lib/std/posix.zig b/lib/std/posix.zig
@@ -52,8 +52,9 @@ else switch (native_os) {
pub const fd_t = void;
pub const uid_t = void;
pub const gid_t = void;
- pub const mode_t = void;
+ pub const mode_t = u0;
pub const ino_t = void;
+ pub const IFNAMESIZE = {};
},
};