diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-10-19 09:34:35 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-19 09:34:35 -0400 |
| commit | 8a344fab3908e1b793fe8f9590696142aee2a1be (patch) | |
| tree | 4c16400718fb200acd2e7766454520dfa90f6772 /lib/std | |
| parent | 7d6596e979df799782b77ce3fed722b792509388 (diff) | |
| parent | cb635e084b0c36e3c7a6bf63f49f7e7e9918532d (diff) | |
| download | zig-8a344fab3908e1b793fe8f9590696142aee2a1be.tar.gz zig-8a344fab3908e1b793fe8f9590696142aee2a1be.zip | |
Merge pull request #13036 from BratishkaErik/fix-installing
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/os/windows.zig | 1 | ||||
| -rw-r--r-- | lib/std/zig/system/NativePaths.zig | 13 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/std/os/windows.zig b/lib/std/os/windows.zig index 081bff845c..d68a66ed87 100644 --- a/lib/std/os/windows.zig +++ b/lib/std/os/windows.zig @@ -134,6 +134,7 @@ pub fn OpenFile(sub_path_w: []const u16, options: OpenFileOptions) OpenError!HAN .OBJECT_NAME_COLLISION => return error.PathAlreadyExists, .FILE_IS_A_DIRECTORY => return error.IsDir, .NOT_A_DIRECTORY => return error.NotDir, + .INVALID_HANDLE => unreachable, else => return unexpectedStatus(rc), } } diff --git a/lib/std/zig/system/NativePaths.zig b/lib/std/zig/system/NativePaths.zig index b28e5e7602..2c4db3ec85 100644 --- a/lib/std/zig/system/NativePaths.zig +++ b/lib/std/zig/system/NativePaths.zig @@ -96,7 +96,7 @@ pub fn detect(allocator: Allocator, native_info: NativeTargetInfo) !NativePaths return self; } - if (comptime native_target.os.tag == .solaris) { + if (builtin.os.tag == .solaris) { try self.addLibDir("/usr/lib/64"); try self.addLibDir("/usr/local/lib/64"); try self.addLibDir("/lib/64"); @@ -107,7 +107,7 @@ pub fn detect(allocator: Allocator, native_info: NativeTargetInfo) !NativePaths return self; } - if (native_target.os.tag != .windows) { + if (builtin.os.tag != .windows) { const triple = try native_target.linuxTriple(allocator); defer allocator.free(triple); @@ -136,11 +136,10 @@ pub fn detect(allocator: Allocator, native_info: NativeTargetInfo) !NativePaths // libz.so.1 is in /lib/x86_64-linux-gnu (added here) try self.addLibDirFmt("/lib/{s}", .{triple}); - // NOTE: distro like guix doesn't use FHS, so it relies on envorinment - // variables (C_INCLUDE_PATH, CPLUS_INCLUDE_PATH and LIBRARY_PATH) to - // search for headers and libraries - // NOTE: we use os.getenv here since this part won't be executed on - // windows, to get rid of unnecessary error handling + // Distros like guix don't use FHS, so they rely on environment + // variables to search for headers and libraries. + // We use os.getenv here since this part won't be executed on + // windows, to get rid of unnecessary error handling. if (std.os.getenv("C_INCLUDE_PATH")) |c_include_path| { var it = mem.tokenize(u8, c_include_path, ":"); while (it.next()) |dir| { |
