diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-07-01 18:14:45 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-07-07 22:43:52 -0700 |
| commit | c8fcd2ff2c032b2de8cc1a57e075552d1cab35df (patch) | |
| tree | 7155f58049ecd0e948533f6b64cba1553dd33ae2 /src/link/MachO/file.zig | |
| parent | f71d97e4cbb0e56213cb76657ad6c9edf6134868 (diff) | |
| download | zig-c8fcd2ff2c032b2de8cc1a57e075552d1cab35df.tar.gz zig-c8fcd2ff2c032b2de8cc1a57e075552d1cab35df.zip | |
MachO: update to new std.io APIs
Diffstat (limited to 'src/link/MachO/file.zig')
| -rw-r--r-- | src/link/MachO/file.zig | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/link/MachO/file.zig b/src/link/MachO/file.zig index d5f8cbd6d0..fde8553260 100644 --- a/src/link/MachO/file.zig +++ b/src/link/MachO/file.zig @@ -14,12 +14,12 @@ pub const File = union(enum) { return .{ .data = file }; } - fn formatPath(file: File, writer: *std.io.Writer) std.io.Writer.Error!void { + fn formatPath(file: File, w: *Writer) Writer.Error!void { switch (file) { - .zig_object => |zo| try writer.writeAll(zo.basename), - .internal => try writer.writeAll("internal"), - .object => |x| try writer.print("{}", .{x.fmtPath()}), - .dylib => |dl| try writer.print("{}", .{@as(Path, dl.path)}), + .zig_object => |zo| try w.writeAll(zo.basename), + .internal => try w.writeAll("internal"), + .object => |x| try w.print("{f}", .{x.fmtPath()}), + .dylib => |dl| try w.print("{f}", .{@as(Path, dl.path)}), } } @@ -321,11 +321,11 @@ pub const File = union(enum) { }; } - pub fn writeAr(file: File, ar_format: Archive.Format, macho_file: *MachO, writer: anytype) !void { + pub fn writeAr(file: File, bw: *Writer, ar_format: Archive.Format, macho_file: *MachO) Writer.Error!void { return switch (file) { .dylib, .internal => unreachable, - .zig_object => |x| x.writeAr(ar_format, writer), - .object => |x| x.writeAr(ar_format, macho_file, writer), + .zig_object => |x| x.writeAr(bw, ar_format), + .object => |x| x.writeAr(bw, ar_format, macho_file), }; } @@ -364,6 +364,7 @@ const log = std.log.scoped(.link); const macho = std.macho; const Allocator = std.mem.Allocator; const Path = std.Build.Cache.Path; +const Writer = std.io.Writer; const trace = @import("../../tracy.zig").trace; const Archive = @import("Archive.zig"); |
