2017-10-02 00:40:30 +08:00
|
|
|
const c = @cImport({
|
2017-10-02 09:05:08 +08:00
|
|
|
// See https://github.com/zig-lang/zig/issues/515
|
|
|
|
@cDefine("_NO_CRT_STDIO_INLINE", "1");
|
2017-10-02 00:40:30 +08:00
|
|
|
@cInclude("stdio.h");
|
|
|
|
@cInclude("string.h");
|
|
|
|
});
|
|
|
|
|
|
|
|
const msg = c"Hello, world!\n";
|
2015-12-12 17:05:08 +08:00
|
|
|
|
2018-01-25 17:10:11 +08:00
|
|
|
export fn main(argc: c_int, argv: &&u8) c_int {
|
2017-10-02 00:40:30 +08:00
|
|
|
if (c.printf(msg) != c_int(c.strlen(msg)))
|
|
|
|
return -1;
|
|
|
|
|
2015-12-16 03:44:42 +08:00
|
|
|
return 0;
|
2015-12-12 17:05:08 +08:00
|
|
|
}
|