| ... | @@ -5,7 +5,11 @@ const tests = @import("tests.zig"); | ... | @@ -5,7 +5,11 @@ const tests = @import("tests.zig"); |
| 5 | | 5 | |
| 6 | pub fn addCases(cases: *tests.CompareOutputContext) void { | 6 | pub fn addCases(cases: *tests.CompareOutputContext) void { |
| 7 | cases.addC("hello world with libc", | 7 | cases.addC("hello world with libc", |
| 8 | \\const c = @cImport(@cInclude("stdio.h")); | 8 | \\const c = @cImport({ |
| | 9 | \\ // See https://github.com/ziglang/zig/issues/515 |
| | 10 | \\ @cDefine("_NO_CRT_STDIO_INLINE", "1"); |
| | 11 | \\ @cInclude("stdio.h"); |
| | 12 | \\}); |
| 9 | \\pub export fn main(argc: c_int, argv: [*][*]u8) c_int { | 13 | \\pub export fn main(argc: c_int, argv: [*][*]u8) c_int { |
| 10 | \\ _ = c.puts("Hello, world!"); | 14 | \\ _ = c.puts("Hello, world!"); |
| 11 | \\ return 0; | 15 | \\ return 0; |