Moved c stdlib variadic functions over to use ...
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
kraken="kraken"
|
kraken="kraken"
|
||||||
bootstrap_commits=(cf46fb13afe66ba475db9725e9269c9c1cd3bbc3 2cd43e5a217318c70097334b3598d2924f64b362 2051f54b559ac5edf67277d4f1134aca2cb9215d ecbbcb4eda56e2467efb0a04e7d668b95856aa4b d126cbf24ba8b26e3814e2260d555ecaee86508c 947384cced5397a517a71963edc8f47e668d734f)
|
bootstrap_commits=(cf46fb13afe66ba475db9725e9269c9c1cd3bbc3 2cd43e5a217318c70097334b3598d2924f64b362 2051f54b559ac5edf67277d4f1134aca2cb9215d ecbbcb4eda56e2467efb0a04e7d668b95856aa4b d126cbf24ba8b26e3814e2260d555ecaee86508c 947384cced5397a517a71963edc8f47e668d734f cfcaff7887a804fe77dadaf2ebb0251d6e8ae8e2)
|
||||||
|
|
||||||
|
|
||||||
# Echo version string to a file included by kraken.krak
|
# Echo version string to a file included by kraken.krak
|
||||||
|
|||||||
@@ -237,8 +237,6 @@ obj ast_transformation (Object) {
|
|||||||
parameters.add(ast_identifier_ptr(concat_symbol_tree(get_node("identifier", child)), param_type, null<ast_node>()))
|
parameters.add(ast_identifier_ptr(concat_symbol_tree(get_node("identifier", child)), param_type, null<ast_node>()))
|
||||||
})
|
})
|
||||||
var is_variadic = get_node("\"...\"", node) != null<tree<symbol>>()
|
var is_variadic = get_node("\"...\"", node) != null<tree<symbol>>()
|
||||||
if (is_variadic)
|
|
||||||
println(function_name + " IS VARIDIC")
|
|
||||||
// figure out function type and make function_node
|
// figure out function type and make function_node
|
||||||
var function_node = ast_function_ptr(function_name, type_ptr(parameters.map(fun(parameter: *ast_node): *type return parameter->identifier.type;), return_type, 0, false, is_variadic), parameters, get_node("\"ext\"", node) != null<tree<symbol>>(), is_variadic)
|
var function_node = ast_function_ptr(function_name, type_ptr(parameters.map(fun(parameter: *ast_node): *type return parameter->identifier.type;), return_type, 0, false, is_variadic), parameters, get_node("\"ext\"", node) != null<tree<symbol>>(), is_variadic)
|
||||||
// fix up the enclosing_scope's
|
// fix up the enclosing_scope's
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ fun println<T>(toPrint: T) : void {
|
|||||||
fun print<T>(toPrint: *T)
|
fun print<T>(toPrint: *T)
|
||||||
print((toPrint) cast ulong)
|
print((toPrint) cast ulong)
|
||||||
|
|
||||||
ext fun printf(fmt_str: *char, to_print: *char): int
|
ext fun printf(fmt_str: *char, ...): int
|
||||||
ext fun fflush(file: int): int
|
ext fun fflush(file: int): int
|
||||||
fun print(toPrint: *char) : void {
|
fun print(toPrint: *char) : void {
|
||||||
printf("%s", toPrint)
|
printf("%s", toPrint)
|
||||||
@@ -38,7 +38,7 @@ fun print(toPrint: bool): void {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ext fun snprintf(to_str: *char, num: ulong, format: *char, d: double): int
|
ext fun snprintf(to_str: *char, num: ulong, format: *char, ...): int
|
||||||
fun print(toPrint: float)
|
fun print(toPrint: float)
|
||||||
print((toPrint) cast double)
|
print((toPrint) cast double)
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ fun print<T>(toPrint: T): void
|
|||||||
// Ok, just some DEAD simple file io for now
|
// Ok, just some DEAD simple file io for now
|
||||||
ext fun fopen(path: *char, mode: *char): *void
|
ext fun fopen(path: *char, mode: *char): *void
|
||||||
ext fun fclose(file: *void): int
|
ext fun fclose(file: *void): int
|
||||||
ext fun fprintf(file: *void, format: *char, data: *char): int
|
ext fun fprintf(file: *void, format: *char, ...): int
|
||||||
ext fun ftell(file: *void): long
|
ext fun ftell(file: *void): long
|
||||||
ext fun fseek(file: *void, offset: long, whence: int): int
|
ext fun fseek(file: *void, offset: long, whence: int): int
|
||||||
ext fun fread(ptr: *void, size: ulong, nmemb: ulong, file: *void): ulong
|
ext fun fread(ptr: *void, size: ulong, nmemb: ulong, file: *void): ulong
|
||||||
|
|||||||
Reference in New Issue
Block a user