mirror of
https://github.com/ziglang/zig.git
synced 2025-12-25 23:53:15 +00:00
macho: improve formatting of invalid targets in libraries
This commit is contained in:
parent
a7240f0c99
commit
19a1332ca1
@ -4912,12 +4912,17 @@ pub fn handleAndReportParseError(
|
||||
error.InvalidTarget, error.InvalidTargetFatLibrary => {
|
||||
var targets_string = std.ArrayList(u8).init(self.base.allocator);
|
||||
defer targets_string.deinit();
|
||||
try targets_string.writer().writeAll("(");
|
||||
for (ctx.detected_targets.items) |t| {
|
||||
try targets_string.writer().print("{s}, ", .{t});
|
||||
|
||||
if (ctx.detected_targets.items.len > 1) {
|
||||
try targets_string.writer().writeAll("(");
|
||||
for (ctx.detected_targets.items) |t| {
|
||||
try targets_string.writer().print("{s}, ", .{t});
|
||||
}
|
||||
try targets_string.resize(targets_string.items.len - 2);
|
||||
try targets_string.writer().writeAll(")");
|
||||
} else {
|
||||
try targets_string.writer().writeAll(ctx.detected_targets.items[0]);
|
||||
}
|
||||
try targets_string.resize(targets_string.items.len - 2);
|
||||
try targets_string.writer().writeAll(")");
|
||||
|
||||
switch (err) {
|
||||
error.InvalidTarget => try self.reportParseError(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user