| ... | @@ -3,6 +3,7 @@ | ... | @@ -3,6 +3,7 @@ |
| 3 | // This file is part of [zig](https://ziglang.org/), which is MIT licensed. | 3 | // This file is part of [zig](https://ziglang.org/), which is MIT licensed. |
| 4 | // The MIT license requires this copyright notice to be included in all copies | 4 | // The MIT license requires this copyright notice to be included in all copies |
| 5 | // and substantial portions of the software. | 5 | // and substantial portions of the software. |
| | 6 | const root = @import("root"); |
| 6 | const builtin = std.builtin; | 7 | const builtin = std.builtin; |
| 7 | const std = @import("std.zig"); | 8 | const std = @import("std.zig"); |
| 8 | const os = std.os; | 9 | const os = std.os; |
| ... | @@ -47,7 +48,10 @@ pub const MAX_PATH_BYTES = switch (builtin.os.tag) { | ... | @@ -47,7 +48,10 @@ pub const MAX_PATH_BYTES = switch (builtin.os.tag) { |
| 47 | .windows => os.windows.PATH_MAX_WIDE * 3 + 1, | 48 | .windows => os.windows.PATH_MAX_WIDE * 3 + 1, |
| 48 | // TODO work out what a reasonable value we should use here | 49 | // TODO work out what a reasonable value we should use here |
| 49 | .wasi => 4096, | 50 | .wasi => 4096, |
| 50 | else => @compileError("Unsupported OS"), | 51 | else => if (@hasDecl(root, "os") and @hasDecl(root.os, "PATH_MAX")) |
| | 52 | root.os.PATH_MAX |
| | 53 | else |
| | 54 | @compileError("PATH_MAX not implemented for " ++ @tagName(builtin.os.tag)), |
| 51 | }; | 55 | }; |
| 52 | | 56 | |
| 53 | pub const base64_alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".*; | 57 | pub const base64_alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".*; |