main returns %void

This commit is contained in:
Andrew Kelley
2016-01-23 02:14:01 -07:00
parent 91d911007b
commit c0ea9290c4
8 changed files with 269 additions and 238 deletions

View File

@@ -4,14 +4,11 @@ import "std.zig";
// Things to do to make this work:
// * var args printing
// * %void type
// * update std API
// * defer
// * %return
// * %% operator
// * make main return %void
// * how to reference error values %.Invalid
// * cast err type to string
// * update std API
pub %.Invalid;

View File

@@ -2,8 +2,7 @@ export executable "hello";
import "std.zig";
pub fn main(args: [][]u8) i32 => {
pub fn main(args: [][]u8) %void => {
//stderr.print_str("Hello, world!\n");
print_str("Hello, world!\n");
return 0;
}

View File

@@ -5,7 +5,7 @@ extern {
fn printf(__format: &const u8, ...) i32;
}
export fn main(argc: i32, argv: &&u8, env: &&u8) i32 => {
export fn main(argc: i32, argv: &&u8) i32 => {
printf(c"Hello, world!\n");
return 0;
}