2017-10-01 09:40:30 -07:00
|
|
|
const c = @cImport({
|
2018-05-24 18:27:44 -07:00
|
|
|
// See https://github.com/ziglang/zig/issues/515
|
2017-10-01 18:05:08 -07:00
|
|
|
@cDefine("_NO_CRT_STDIO_INLINE", "1");
|
2017-10-01 09:40:30 -07:00
|
|
|
@cInclude("stdio.h");
|
2019-05-27 12:48:31 -07:00
|
|
|
@cInclude("string.h");
|
2017-10-01 09:40:30 -07:00
|
|
|
});
|
|
|
|
|
2019-11-19 17:29:08 -08:00
|
|
|
const msg = "Hello, world!\n";
|
2019-05-27 12:48:31 -07:00
|
|
|
|
2019-12-01 01:31:18 -08:00
|
|
|
pub export fn main(argc: c_int, argv: **u8) c_int {
|
2019-05-27 12:48:31 -07:00
|
|
|
if (c.printf(msg) != @intCast(c_int, c.strlen(msg))) return -1;
|
2015-12-15 11:44:42 -08:00
|
|
|
return 0;
|
2015-12-12 01:05:08 -08:00
|
|
|
}
|