aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/c.zig
diff options
context:
space:
mode:
authorJonathan Marler <johnnymarler@gmail.com>2021-01-03 13:49:51 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-01-07 23:49:22 -0800
commit31802c6c68a98bdbe34766d3cfdaf65b782851da (patch)
tree88ea8704da9344e62347bee9b064d4c42cfdec83 /src/codegen/c.zig
parenta9b505fa7774e2e8451bedfa7bea27d7227572e7 (diff)
downloadzig-31802c6c68a98bdbe34766d3cfdaf65b782851da.tar.gz
zig-31802c6c68a98bdbe34766d3cfdaf65b782851da.zip
remove z/Z format specifiers
Zig's format system is flexible enough to add custom formatters. This PR removes the new z/Z format specifiers that were added for printing Zig identifiers and replaces them with custom formatters.
Diffstat (limited to 'src/codegen/c.zig')
-rw-r--r--src/codegen/c.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index 3de79e2a3d..8c85f482fd 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -169,8 +169,8 @@ pub const DeclGen = struct {
.undef, .empty_struct_value, .empty_array => try writer.writeAll("{}"),
.bytes => {
const bytes = val.castTag(.bytes).?.data;
- // TODO: make our own C string escape instead of using {Z}
- try writer.print("\"{Z}\"", .{bytes});
+ // TODO: make our own C string escape instead of using std.zig.fmtEscapes
+ try writer.print("\"{}\"", .{std.zig.fmtEscapes(bytes)});
},
else => {
// Fall back to generic implementation.