authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-17 13:34:46-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-29 06:20:50-07:00
log43c2ba375db502be3d6ba45cd5e949482e14bfae
treee9c9d3bb362346fd2108f0f9724fc3fdf366d350
parent752d38612f97d7c9aa203615bdde772a71b1330f

std: accessZ -> access


3 files changed, 9 insertions(+), 9 deletions(-)

lib/std/Build/Step/Compile.zig+2-2
...@@ -1701,7 +1701,7 @@ fn getZigArgs(compile: *Compile, fuzz: bool) ![][]const u8 {...@@ -1701,7 +1701,7 @@ fn getZigArgs(compile: *Compile, fuzz: bool) ![][]const u8 {
1701 // This prevents a warning, that should probably be upgraded to an error in Zig's1701 // This prevents a warning, that should probably be upgraded to an error in Zig's
1702 // CLI parsing code, when the linker sees an -L directory that does not exist.1702 // 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", .{})) |_| {
1705 try zig_args.appendSlice(&.{1705 try zig_args.appendSlice(&.{
1706 "-L", b.pathJoin(&.{ search_prefix, "lib" }),1706 "-L", b.pathJoin(&.{ search_prefix, "lib" }),
1707 });1707 });
...@@ -1712,7 +1712,7 @@ fn getZigArgs(compile: *Compile, fuzz: bool) ![][]const u8 {...@@ -1712,7 +1712,7 @@ fn getZigArgs(compile: *Compile, fuzz: bool) ![][]const u8 {
1712 }),1712 }),
1713 }1713 }
17141714
1715 if (prefix_dir.accessZ("include", .{})) |_| {1715 if (prefix_dir.access("include", .{})) |_| {
1716 try zig_args.appendSlice(&.{1716 try zig_args.appendSlice(&.{
1717 "-I", b.pathJoin(&.{ search_prefix, "include" }),1717 "-I", b.pathJoin(&.{ search_prefix, "include" }),
1718 });1718 });
lib/std/os.zig+1-1
...@@ -57,7 +57,7 @@ pub var argv: [][*:0]u8 = if (builtin.link_libc) undefined else switch (native_o...@@ -57,7 +57,7 @@ pub var argv: [][*:0]u8 = if (builtin.link_libc) undefined else switch (native_o
57};57};
5858
59/// Call from Windows-specific code if you already have a WTF-16LE encoded, null terminated string.59/// 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`.
61pub fn accessW(path: [*:0]const u16) windows.GetFileAttributesError!void {61pub fn accessW(path: [*:0]const u16) windows.GetFileAttributesError!void {
62 const ret = try windows.GetFileAttributesW(path);62 const ret = try windows.GetFileAttributesW(path);
63 if (ret != windows.INVALID_FILE_ATTRIBUTES) {63 if (ret != windows.INVALID_FILE_ATTRIBUTES) {
lib/std/zig/LibCInstallation.zig+6-6
...@@ -329,7 +329,7 @@ fn findNativeIncludeDirPosix(self: *LibCInstallation, args: FindNativeOptions) F...@@ -329,7 +329,7 @@ fn findNativeIncludeDirPosix(self: *LibCInstallation, args: FindNativeOptions) F
329 defer search_dir.close();329 defer search_dir.close();
330330
331 if (self.include_dir == null) {331 if (self.include_dir == null) {
332 if (search_dir.accessZ(include_dir_example_file, .{})) |_| {332 if (search_dir.access(include_dir_example_file, .{})) |_| {
333 self.include_dir = try allocator.dupeZ(u8, search_path);333 self.include_dir = try allocator.dupeZ(u8, search_path);
334 } else |err| switch (err) {334 } else |err| switch (err) {
335 error.FileNotFound => {},335 error.FileNotFound => {},
...@@ -338,7 +338,7 @@ fn findNativeIncludeDirPosix(self: *LibCInstallation, args: FindNativeOptions) F...@@ -338,7 +338,7 @@ fn findNativeIncludeDirPosix(self: *LibCInstallation, args: FindNativeOptions) F
338 }338 }
339339
340 if (self.sys_include_dir == null) {340 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, .{})) |_| {
342 self.sys_include_dir = try allocator.dupeZ(u8, search_path);342 self.sys_include_dir = try allocator.dupeZ(u8, search_path);
343 } else |err| switch (err) {343 } else |err| switch (err) {
344 error.FileNotFound => {},344 error.FileNotFound => {},
...@@ -382,7 +382,7 @@ fn findNativeIncludeDirWindows(...@@ -382,7 +382,7 @@ fn findNativeIncludeDirWindows(
382 };382 };
383 defer dir.close();383 defer dir.close();
384384
385 dir.accessZ("stdlib.h", .{}) catch |err| switch (err) {385 dir.access("stdlib.h", .{}) catch |err| switch (err) {
386 error.FileNotFound => continue,386 error.FileNotFound => continue,
387 else => return error.FileSystem,387 else => return error.FileSystem,
388 };388 };
...@@ -429,7 +429,7 @@ fn findNativeCrtDirWindows(...@@ -429,7 +429,7 @@ fn findNativeCrtDirWindows(
429 };429 };
430 defer dir.close();430 defer dir.close();
431431
432 dir.accessZ("ucrt.lib", .{}) catch |err| switch (err) {432 dir.access("ucrt.lib", .{}) catch |err| switch (err) {
433 error.FileNotFound => continue,433 error.FileNotFound => continue,
434 else => return error.FileSystem,434 else => return error.FileSystem,
435 };435 };
...@@ -496,7 +496,7 @@ fn findNativeKernel32LibDir(...@@ -496,7 +496,7 @@ fn findNativeKernel32LibDir(
496 };496 };
497 defer dir.close();497 defer dir.close();
498498
499 dir.accessZ("kernel32.lib", .{}) catch |err| switch (err) {499 dir.access("kernel32.lib", .{}) catch |err| switch (err) {
500 error.FileNotFound => continue,500 error.FileNotFound => continue,
501 else => return error.FileSystem,501 else => return error.FileSystem,
502 };502 };
...@@ -531,7 +531,7 @@ fn findNativeMsvcIncludeDir(...@@ -531,7 +531,7 @@ fn findNativeMsvcIncludeDir(
531 };531 };
532 defer dir.close();532 defer dir.close();
533533
534 dir.accessZ("vcruntime.h", .{}) catch |err| switch (err) {534 dir.access("vcruntime.h", .{}) catch |err| switch (err) {
535 error.FileNotFound => return error.LibCStdLibHeaderNotFound,535 error.FileNotFound => return error.LibCStdLibHeaderNotFound,
536 else => return error.FileSystem,536 else => return error.FileSystem,
537 };537 };