mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
fix aro translate-c building from source
This commit is contained in:
parent
e97a0ffb60
commit
c873c2eed9
2
lib/compiler/aro/aro/Driver.zig
vendored
2
lib/compiler/aro/aro/Driver.zig
vendored
@ -519,7 +519,7 @@ fn option(arg: []const u8, name: []const u8) ?[]const u8 {
|
||||
|
||||
fn addSource(d: *Driver, path: []const u8) !Source {
|
||||
if (mem.eql(u8, "-", path)) {
|
||||
const stdin = std.fs.File.stdin().reader();
|
||||
const stdin = std.fs.File.stdin().deprecatedReader();
|
||||
const input = try stdin.readAllAlloc(d.comp.gpa, std.math.maxInt(u32));
|
||||
defer d.comp.gpa.free(input);
|
||||
return d.comp.addSourceFromBuffer("<stdin>", input);
|
||||
|
||||
@ -1781,7 +1781,8 @@ test "Macro matching" {
|
||||
fn renderErrorsAndExit(comp: *aro.Compilation) noreturn {
|
||||
defer std.process.exit(1);
|
||||
|
||||
var writer = aro.Diagnostics.defaultMsgWriter(std.io.tty.detectConfig(std.fs.File.stderr()));
|
||||
var buffer: [1000]u8 = undefined;
|
||||
var writer = aro.Diagnostics.defaultMsgWriter(std.io.tty.detectConfig(std.fs.File.stderr()), &buffer);
|
||||
defer writer.deinit(); // writer deinit must run *before* exit so that stderr is flushed
|
||||
|
||||
var saw_error = false;
|
||||
|
||||
@ -145,7 +145,7 @@ fn mainImpl() !void {
|
||||
var parser = try Parser.init(gpa);
|
||||
defer parser.deinit();
|
||||
|
||||
var stdin_buf = std.io.bufferedReader(std.fs.File.stdin().reader());
|
||||
var stdin_buf = std.io.bufferedReader(std.fs.File.stdin().deprecatedReader());
|
||||
var line_buf = std.ArrayList(u8).init(gpa);
|
||||
defer line_buf.deinit();
|
||||
while (stdin_buf.reader().streamUntilDelimiter(line_buf.writer(), '\n', null)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user