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;...@@ -32,11 +32,7 @@ pub const Kind = Io.File.Kind;
32/// the `touch` command, which would correspond to `0o644`. However, POSIX32/// the `touch` command, which would correspond to `0o644`. However, POSIX
33/// libc implementations use `0o666` inside `fopen` and then rely on the33/// libc implementations use `0o666` inside `fopen` and then rely on the
34/// process-scoped "umask" setting to adjust this number for file creation.34/// process-scoped "umask" setting to adjust this number for file creation.
35pub const default_mode = switch (builtin.os.tag) {35pub const default_mode: Mode = if (Mode == u0) 0 else 0o666;
36 .windows => 0,
37 .wasi => 0,
38 else => 0o666,
39};
4036
41/// Deprecated in favor of `Io.File.OpenError`.37/// Deprecated in favor of `Io.File.OpenError`.
42pub const OpenError = Io.File.OpenError || error{WouldBlock};38pub const OpenError = Io.File.OpenError || error{WouldBlock};
lib/std/posix.zig+2-1
...@@ -52,8 +52,9 @@ else switch (native_os) {...@@ -52,8 +52,9 @@ else switch (native_os) {
52 pub const fd_t = void;52 pub const fd_t = void;
53 pub const uid_t = void;53 pub const uid_t = void;
54 pub const gid_t = void;54 pub const gid_t = void;
55 pub const mode_t = void;55 pub const mode_t = u0;
56 pub const ino_t = void;56 pub const ino_t = void;
57 pub const IFNAMESIZE = {};
57 },58 },
58};59};
5960