authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-21 14:12:28-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-29 06:20:51-07:00
log2f260256903a5130e879ab7dc020fa160befc4d9
treedabdd3997536cea2ae5eaf689ab0806c7a3d66cb
parent00a3123fbe79d9bb74b2c877130579299d2ba5ba

std: fix build failure on wasm32-freestanding


2 files changed, 3 insertions(+), 6 deletions(-)

lib/std/fs/File.zig+1-5
......@@ -32,11 +32,7 @@ pub const Kind = Io.File.Kind;
3232/// the `touch` command, which would correspond to `0o644`. However, POSIX
3333/// libc implementations use `0o666` inside `fopen` and then rely on the
3434/// process-scoped "umask" setting to adjust this number for file creation.
35pub const default_mode = switch (builtin.os.tag) {
36 .windows => 0,
37 .wasi => 0,
38 else => 0o666,
39};
35pub const default_mode: Mode = if (Mode == u0) 0 else 0o666;
4036
4137/// Deprecated in favor of `Io.File.OpenError`.
4238pub const OpenError = Io.File.OpenError || error{WouldBlock};
lib/std/posix.zig+2-1
......@@ -52,8 +52,9 @@ else switch (native_os) {
5252 pub const fd_t = void;
5353 pub const uid_t = void;
5454 pub const gid_t = void;
55 pub const mode_t = void;
55 pub const mode_t = u0;
5656 pub const ino_t = void;
57 pub const IFNAMESIZE = {};
5758 },
5859};
5960