diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig index 0f47a0b647..2188d8bfc7 100644 --- a/lib/std/Build/Step/Compile.zig +++ b/lib/std/Build/Step/Compile.zig @@ -1701,7 +1701,7 @@ fn getZigArgs(compile: *Compile, fuzz: bool) ![][]const u8 { // This prevents a warning, that should probably be upgraded to an error in Zig's // CLI parsing code, when the linker sees an -L directory that does not exist. - if (prefix_dir.accessZ("lib", .{})) |_| { + if (prefix_dir.access("lib", .{})) |_| { try zig_args.appendSlice(&.{ "-L", b.pathJoin(&.{ search_prefix, "lib" }), }); @@ -1712,7 +1712,7 @@ fn getZigArgs(compile: *Compile, fuzz: bool) ![][]const u8 { }), } - if (prefix_dir.accessZ("include", .{})) |_| { + if (prefix_dir.access("include", .{})) |_| { try zig_args.appendSlice(&.{ "-I", b.pathJoin(&.{ search_prefix, "include" }), }); diff --git a/lib/std/os.zig b/lib/std/os.zig index 7bee7ed104..8a2c606661 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -57,7 +57,7 @@ pub var argv: [][*:0]u8 = if (builtin.link_libc) undefined else switch (native_o }; /// Call from Windows-specific code if you already have a WTF-16LE encoded, null terminated string. -/// Otherwise use `access` or `accessZ`. +/// Otherwise use `access`. pub fn accessW(path: [*:0]const u16) windows.GetFileAttributesError!void { const ret = try windows.GetFileAttributesW(path); if (ret != windows.INVALID_FILE_ATTRIBUTES) { diff --git a/lib/std/zig/LibCInstallation.zig b/lib/std/zig/LibCInstallation.zig index f6d381be82..2ab4e48570 100644 --- a/lib/std/zig/LibCInstallation.zig +++ b/lib/std/zig/LibCInstallation.zig @@ -329,7 +329,7 @@ fn findNativeIncludeDirPosix(self: *LibCInstallation, args: FindNativeOptions) F defer search_dir.close(); if (self.include_dir == null) { - if (search_dir.accessZ(include_dir_example_file, .{})) |_| { + if (search_dir.access(include_dir_example_file, .{})) |_| { self.include_dir = try allocator.dupeZ(u8, search_path); } else |err| switch (err) { error.FileNotFound => {}, @@ -338,7 +338,7 @@ fn findNativeIncludeDirPosix(self: *LibCInstallation, args: FindNativeOptions) F } if (self.sys_include_dir == null) { - if (search_dir.accessZ(sys_include_dir_example_file, .{})) |_| { + if (search_dir.access(sys_include_dir_example_file, .{})) |_| { self.sys_include_dir = try allocator.dupeZ(u8, search_path); } else |err| switch (err) { error.FileNotFound => {}, @@ -382,7 +382,7 @@ fn findNativeIncludeDirWindows( }; defer dir.close(); - dir.accessZ("stdlib.h", .{}) catch |err| switch (err) { + dir.access("stdlib.h", .{}) catch |err| switch (err) { error.FileNotFound => continue, else => return error.FileSystem, }; @@ -429,7 +429,7 @@ fn findNativeCrtDirWindows( }; defer dir.close(); - dir.accessZ("ucrt.lib", .{}) catch |err| switch (err) { + dir.access("ucrt.lib", .{}) catch |err| switch (err) { error.FileNotFound => continue, else => return error.FileSystem, }; @@ -496,7 +496,7 @@ fn findNativeKernel32LibDir( }; defer dir.close(); - dir.accessZ("kernel32.lib", .{}) catch |err| switch (err) { + dir.access("kernel32.lib", .{}) catch |err| switch (err) { error.FileNotFound => continue, else => return error.FileSystem, }; @@ -531,7 +531,7 @@ fn findNativeMsvcIncludeDir( }; defer dir.close(); - dir.accessZ("vcruntime.h", .{}) catch |err| switch (err) { + dir.access("vcruntime.h", .{}) catch |err| switch (err) { error.FileNotFound => return error.LibCStdLibHeaderNotFound, else => return error.FileSystem, };