Commit 2f26025690

Andrew Kelley <andrew@ziglang.org>
2025-10-21 23:12:28
std: fix build failure on wasm32-freestanding
1 parent 00a3123
Changed files (2)
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};
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 = {};
     },
 };