summaryrefslogtreecommitdiff
path: root/std
diff options
context:
space:
mode:
Diffstat (limited to 'std')
-rw-r--r--std/io.toc9
1 files changed, 3 insertions, 6 deletions
diff --git a/std/io.toc b/std/io.toc
index 17c4bbb..30696de 100644
--- a/std/io.toc
+++ b/std/io.toc
@@ -3,14 +3,11 @@ toc_putchar ::= fn(x: char) {
putchar(x as #C int);
};
-fwrite ::= #foreign("fwrite", "libc.so.6") fn(#C &"void", #C size_t, #C size_t, #C &"void") #C size_t;
-
-stdout_fwrite ::= fn(data: &u8, size: u64, nmemb: u64) {
- fwrite(data, size as #C size_t, nmemb as #C size_t, #builtin("stdout"));
-};
puts ::= fn(x: []char) {
- stdout_fwrite(&x[0] as &u8, 1, x.len as u64);
+ for c := x {
+ toc_putchar(c);
+ }
toc_putchar('\n');
};