Skip to content

Commit 9c20f4f

Browse files
committed
std: accessZ -> access
1 parent 1501e8d commit 9c20f4f

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

lib/std/Build/Step/Compile.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,7 +1701,7 @@ fn getZigArgs(compile: *Compile, fuzz: bool) ![][]const u8 {
17011701
// This prevents a warning, that should probably be upgraded to an error in Zig's
17021702
// CLI parsing code, when the linker sees an -L directory that does not exist.
17031703

1704-
if (prefix_dir.accessZ("lib", .{})) |_| {
1704+
if (prefix_dir.access("lib", .{})) |_| {
17051705
try zig_args.appendSlice(&.{
17061706
"-L", b.pathJoin(&.{ search_prefix, "lib" }),
17071707
});
@@ -1712,7 +1712,7 @@ fn getZigArgs(compile: *Compile, fuzz: bool) ![][]const u8 {
17121712
}),
17131713
}
17141714

1715-
if (prefix_dir.accessZ("include", .{})) |_| {
1715+
if (prefix_dir.access("include", .{})) |_| {
17161716
try zig_args.appendSlice(&.{
17171717
"-I", b.pathJoin(&.{ search_prefix, "include" }),
17181718
});

lib/std/os.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub var argv: [][*:0]u8 = if (builtin.link_libc) undefined else switch (native_o
5757
};
5858

5959
/// Call from Windows-specific code if you already have a WTF-16LE encoded, null terminated string.
60-
/// Otherwise use `access` or `accessZ`.
60+
/// Otherwise use `access`.
6161
pub fn accessW(path: [*:0]const u16) windows.GetFileAttributesError!void {
6262
const ret = try windows.GetFileAttributesW(path);
6363
if (ret != windows.INVALID_FILE_ATTRIBUTES) {

lib/std/zig/LibCInstallation.zig

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ fn findNativeIncludeDirPosix(self: *LibCInstallation, args: FindNativeOptions) F
329329
defer search_dir.close();
330330

331331
if (self.include_dir == null) {
332-
if (search_dir.accessZ(include_dir_example_file, .{})) |_| {
332+
if (search_dir.access(include_dir_example_file, .{})) |_| {
333333
self.include_dir = try allocator.dupeZ(u8, search_path);
334334
} else |err| switch (err) {
335335
error.FileNotFound => {},
@@ -338,7 +338,7 @@ fn findNativeIncludeDirPosix(self: *LibCInstallation, args: FindNativeOptions) F
338338
}
339339

340340
if (self.sys_include_dir == null) {
341-
if (search_dir.accessZ(sys_include_dir_example_file, .{})) |_| {
341+
if (search_dir.access(sys_include_dir_example_file, .{})) |_| {
342342
self.sys_include_dir = try allocator.dupeZ(u8, search_path);
343343
} else |err| switch (err) {
344344
error.FileNotFound => {},
@@ -382,7 +382,7 @@ fn findNativeIncludeDirWindows(
382382
};
383383
defer dir.close();
384384

385-
dir.accessZ("stdlib.h", .{}) catch |err| switch (err) {
385+
dir.access("stdlib.h", .{}) catch |err| switch (err) {
386386
error.FileNotFound => continue,
387387
else => return error.FileSystem,
388388
};
@@ -429,7 +429,7 @@ fn findNativeCrtDirWindows(
429429
};
430430
defer dir.close();
431431

432-
dir.accessZ("ucrt.lib", .{}) catch |err| switch (err) {
432+
dir.access("ucrt.lib", .{}) catch |err| switch (err) {
433433
error.FileNotFound => continue,
434434
else => return error.FileSystem,
435435
};
@@ -496,7 +496,7 @@ fn findNativeKernel32LibDir(
496496
};
497497
defer dir.close();
498498

499-
dir.accessZ("kernel32.lib", .{}) catch |err| switch (err) {
499+
dir.access("kernel32.lib", .{}) catch |err| switch (err) {
500500
error.FileNotFound => continue,
501501
else => return error.FileSystem,
502502
};
@@ -531,7 +531,7 @@ fn findNativeMsvcIncludeDir(
531531
};
532532
defer dir.close();
533533

534-
dir.accessZ("vcruntime.h", .{}) catch |err| switch (err) {
534+
dir.access("vcruntime.h", .{}) catch |err| switch (err) {
535535
error.FileNotFound => return error.LibCStdLibHeaderNotFound,
536536
else => return error.FileSystem,
537537
};

0 commit comments

Comments
 (0)