diff options
| author | Joao Matos <[email protected]> | 2021-02-04 16:12:04 +0000 |
|---|---|---|
| committer | Joao Matos <[email protected]> | 2021-02-04 16:23:55 +0000 |
| commit | ab2f5db2e1d30b1184b1546ad275890381048b04 (patch) | |
| tree | b6c1889edbe5d0c99fe7b79d60269373dfe2b3aa | |
| parent | a3a58f8dbc6a6cbfc5a2ece6b2b5c56a24408297 (diff) | |
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)}); } |
