authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-11-19 19:15:14-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-11-19 19:15:14-07:00
loge24dcd2707b5956cd53d4b38dc3ac6be0cf0a264
tree8ea6a97af42a4f2b806a4eae6c34c5cabb7c0fbc
parent696e51be4971631b05bd9eda52e36c7be3a83342

std.builtin.StackTrace: format() workaround on freestanding

This whole thing needs to be reworked but for now at least don't cause a compile error when building for a target that doesn't have stderr or detectTTYConfig.

1 files changed, 5 insertions(+), 0 deletions(-)

lib/std/builtin.zig+5
......@@ -61,6 +61,11 @@ pub const StackTrace = struct {
6161 options: std.fmt.FormatOptions,
6262 writer: anytype,
6363 ) !void {
64 // TODO: re-evaluate whether to use format() methods at all.
65 // Until then, avoid an error when using GeneralPurposeAllocator with WebAssembly
66 // where it tries to call detectTTYConfig here.
67 if (builtin.os.tag == .freestanding) return;
68
6469 _ = fmt;
6570 _ = options;
6671 var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);