MachO: update to new std.io APIs

This commit is contained in:
Andrew Kelley
2025-07-01 18:14:45 -07:00
parent f71d97e4cb
commit c8fcd2ff2c
25 changed files with 1591 additions and 1660 deletions

View File

@@ -444,7 +444,7 @@ pub fn renderMessage(comp: *Compilation, m: anytype, msg: Message) void {
printRt(m, prop.msg, .{"{s}"}, .{&str});
} else {
var buf: [3]u8 = undefined;
const str = std.fmt.bufPrint(&buf, "x{x}", .{&.{msg.extra.invalid_escape.char}}) catch unreachable;
const str = std.fmt.bufPrint(&buf, "x{x}", .{msg.extra.invalid_escape.char}) catch unreachable;
printRt(m, prop.msg, .{"{s}"}, .{str});
}
},
@@ -525,13 +525,13 @@ fn tagKind(d: *Diagnostics, tag: Tag, langopts: LangOpts) Kind {
}
const MsgWriter = struct {
w: std.io.BufferedWriter(4096, std.fs.File.Writer),
w: *std.fs.File.Writer,
config: std.io.tty.Config,
fn init(config: std.io.tty.Config) MsgWriter {
fn init(config: std.io.tty.Config, buffer: []u8) MsgWriter {
std.debug.lockStdErr();
return .{
.w = std.io.bufferedWriter(std.fs.File.stderr().deprecatedWriter()),
.w = std.fs.stderr().writer(buffer),
.config = config,
};
}