std: accessZ -> access

This commit is contained in:
Andrew Kelley 2025-10-17 13:34:46 -07:00
parent 752d38612f
commit 43c2ba375d
3 changed files with 9 additions and 9 deletions

View file

@ -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" }),
});

View file

@ -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) {

View file

@ -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,
};