mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
Change std.os to std.posix in error messages
This commit is contained in:
parent
20b9b54e6b
commit
8ea4283d83
1 changed files with 4 additions and 4 deletions
|
|
@ -717,7 +717,7 @@ pub fn raise(sig: u8) RaiseError!void {
|
|||
}
|
||||
}
|
||||
|
||||
@compileError("std.os.raise unimplemented for this target");
|
||||
@compileError("std.posix.raise unimplemented for this target");
|
||||
}
|
||||
|
||||
pub const KillError = error{ ProcessNotFound, PermissionDenied } || UnexpectedError;
|
||||
|
|
@ -1932,7 +1932,7 @@ pub fn execvpeZ(
|
|||
/// See also `getenvZ`.
|
||||
pub fn getenv(key: []const u8) ?[:0]const u8 {
|
||||
if (native_os == .windows) {
|
||||
@compileError("std.os.getenv is unavailable for Windows because environment strings are in WTF-16 format. See std.process.getEnvVarOwned for a cross-platform API or std.process.getenvW for a Windows-specific API.");
|
||||
@compileError("std.posix.getenv is unavailable for Windows because environment strings are in WTF-16 format. See std.process.getEnvVarOwned for a cross-platform API or std.process.getenvW for a Windows-specific API.");
|
||||
}
|
||||
if (builtin.link_libc) {
|
||||
var ptr = std.c.environ;
|
||||
|
|
@ -1948,7 +1948,7 @@ pub fn getenv(key: []const u8) ?[:0]const u8 {
|
|||
return null;
|
||||
}
|
||||
if (native_os == .wasi) {
|
||||
@compileError("std.os.getenv is unavailable for WASI. See std.process.getEnvMap or std.process.getEnvVarOwned for a cross-platform API.");
|
||||
@compileError("std.posix.getenv is unavailable for WASI. See std.process.getEnvMap or std.process.getEnvVarOwned for a cross-platform API.");
|
||||
}
|
||||
// The simplified start logic doesn't populate environ.
|
||||
if (std.start.simplified_logic) return null;
|
||||
|
|
@ -1972,7 +1972,7 @@ pub fn getenvZ(key: [*:0]const u8) ?[:0]const u8 {
|
|||
return mem.sliceTo(value, 0);
|
||||
}
|
||||
if (native_os == .windows) {
|
||||
@compileError("std.os.getenvZ is unavailable for Windows because environment string is in WTF-16 format. See std.process.getEnvVarOwned for cross-platform API or std.process.getenvW for Windows-specific API.");
|
||||
@compileError("std.posix.getenvZ is unavailable for Windows because environment string is in WTF-16 format. See std.process.getEnvVarOwned for cross-platform API or std.process.getenvW for Windows-specific API.");
|
||||
}
|
||||
return getenv(mem.sliceTo(key, 0));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue