Add void type
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
namespace c
|
||||
|
||||
extern func printf(fmt: ^u8, ...args: any)
|
||||
extern func printf(fmt: ^u8, ...args: any): void
|
||||
extern func getchar(): i32
|
||||
extern func puts(fmt: ^u8)
|
||||
|
||||
extern func malloc(size: i64): ^any
|
||||
extern func calloc(num: i64, size: i64): ^any
|
||||
extern func realloc(ptr: ^any, size: i64): ^any
|
||||
extern func free(ptr: ^any)
|
||||
extern func malloc(size: i64): ^void
|
||||
extern func calloc(num: i64, size: i64): ^void
|
||||
extern func realloc(ptr: ^void, size: i64): ^void
|
||||
extern func free(ptr: ^void)
|
||||
|
||||
extern func sin(x: f64): f64
|
||||
extern func cos(x: f64): f64
|
||||
|
||||
@@ -4,7 +4,7 @@ struct Human {
|
||||
age: ^u64
|
||||
}
|
||||
|
||||
export func main(args: []^string) {
|
||||
export func main(args: []^string): i64 {
|
||||
let x = [3]f64
|
||||
|
||||
x[0] = 1
|
||||
@@ -14,4 +14,6 @@ export func main(args: []^string) {
|
||||
c::printf("%f\n", x[0])
|
||||
c::printf("%f\n", x[1])
|
||||
c::printf("%f\n", x[2])
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user