Basic CTCE working! In between commit because #link(a) syntax changed to #link(a)
This commit is contained in:
@@ -4,7 +4,6 @@ import mem:*
|
||||
|
||||
ext fun printf(fmt_str: *char, ...): int
|
||||
ext fun fprintf(file: *void, format: *char, ...): int
|
||||
ext fun snprintf(to_str: *char, num: ulong, format: *char, ...): int
|
||||
ext fun fflush(file: int): int
|
||||
ext var stderr: *void
|
||||
ext fun fgets(buff: *char, size: int, file: *void): *char
|
||||
@@ -63,16 +62,6 @@ fun print(toPrint: bool) {
|
||||
else
|
||||
print("false")
|
||||
}
|
||||
fun print(toPrint: float)
|
||||
print((toPrint) cast double)
|
||||
|
||||
fun print(toPrint: double) {
|
||||
var how_much = snprintf(null<char>(), (0) cast ulong, "%f", toPrint)
|
||||
var int_str = new<char>(how_much+2)
|
||||
snprintf(int_str, (how_much+1) cast ulong, "%f", toPrint)
|
||||
print(int_str)
|
||||
delete(int_str)
|
||||
}
|
||||
fun print<T>(toPrint: T): void
|
||||
print(string::to_string(toPrint))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user