diff options
| author | ruki <[email protected]> | 2021-02-05 06:42:43 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-02-05 06:42:43 +0800 |
| commit | 951d1fe16413156b9315d1ffb5a52e0378ed7bcd (patch) | |
| tree | 3ea669efbcc2cdae6f5121ca2ad44ebe0be4547f | |
| parent | 17170a1147170218b7669001ce870b8372cd0dc3 (diff) | |
| parent | ab2f5db2e1d30b1184b1546ad275890381048b04 (diff) | |
Merge pull request #1231 from tritao/zig-template-console-fix
Fix Zig templates to work with latest toolchain version
4 files changed, 8 insertions, 8 deletions
diff --git a/xmake/templates/zig/console/project/src/main.zig b/xmake/templates/zig/console/project/src/main.zig index fcfd5e0fa..259e332e6 100644 --- a/xmake/templates/zig/console/project/src/main.zig +++ b/xmake/templates/zig/console/project/src/main.zig @@ -1,6 +1,6 @@ const std = @import("std"); pub fn main() !void { - const stdout = std.io.getStdOut().outStream(); - try stdout.print("Hello, {}!\n", .{"world"}); + const stdout = std.io.getStdOut().writer(); + try stdout.print("Hello, {s}!\n", .{"world"}); } diff --git a/xmake/templates/zig/console/project/src/test.zig b/xmake/templates/zig/console/project/src/test.zig index 84804603e..605d168c4 100644 --- a/xmake/templates/zig/console/project/src/test.zig +++ b/xmake/templates/zig/console/project/src/test.zig @@ -1,6 +1,6 @@ const std = @import("std"); pub fn hello() !void { - const stdout = std.io.getStdOut().outStream(); - try stdout.print("Hello, {}!\n", .{"world"}); + const stdout = std.io.getStdOut().writer(); + try stdout.print("Hello, {s}!\n", .{"world"}); } diff --git a/xmake/templates/zig/shared/project/src/main.zig b/xmake/templates/zig/shared/project/src/main.zig index cee64b6b7..444a25407 100644 --- a/xmake/templates/zig/shared/project/src/main.zig +++ b/xmake/templates/zig/shared/project/src/main.zig @@ -3,6 +3,6 @@ const std = @import("std"); extern fn add(a: i32, b: i32) i32; pub fn main() !void { - const stdout = std.io.getStdOut().outStream(); - try stdout.print("Hello, {} - {}!\n", .{"world", add(1, 1)}); + const stdout = std.io.getStdOut().writer(); + try stdout.print("Hello, {s} - {d}!\n", .{"world", add(1, 1)}); } diff --git a/xmake/templates/zig/static/project/src/main.zig b/xmake/templates/zig/static/project/src/main.zig index cee64b6b7..444a25407 100644 --- a/xmake/templates/zig/static/project/src/main.zig +++ b/xmake/templates/zig/static/project/src/main.zig @@ -3,6 +3,6 @@ const std = @import("std"); extern fn add(a: i32, b: i32) i32; pub fn main() !void { - const stdout = std.io.getStdOut().outStream(); - try stdout.print("Hello, {} - {}!\n", .{"world", add(1, 1)}); + const stdout = std.io.getStdOut().writer(); + try stdout.print("Hello, {s} - {d}!\n", .{"world", add(1, 1)}); } |
