parent
a2e6ada1c6
commit
4bf149795a
|
@ -1,5 +1,5 @@
|
||||||
const io = @import("std").io;
|
const io = @import("std").io;
|
||||||
|
|
||||||
pub fn main() -> %void {
|
pub fn main() -> %void {
|
||||||
%%io.stdout.printf("Hello, world!\n");
|
%return io.stdout.printf("Hello, world!\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
const c = @cImport(@cInclude("stdio.h"));
|
const c = @cImport({
|
||||||
|
@cInclude("stdio.h");
|
||||||
|
@cInclude("string.h");
|
||||||
|
});
|
||||||
|
|
||||||
|
const msg = c"Hello, world!\n";
|
||||||
|
|
||||||
export fn main(argc: c_int, argv: &&u8) -> c_int {
|
export fn main(argc: c_int, argv: &&u8) -> c_int {
|
||||||
_ = c.printf(c"Hello, world!\n");
|
if (c.printf(msg) != c_int(c.strlen(msg)))
|
||||||
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue