summaryrefslogtreecommitdiff
path: root/std
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-03-11 11:09:23 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-03-11 11:09:23 -0400
commit4147b72ee33d6aa3aae1154017679cdf0f304c61 (patch)
tree3fb1d1e141e8a224a0dc4a9eeaa259042daf1938 /std
parent0469df66bd9c907b7a90241ab8ed7eb716d7f700 (diff)
fixed std/io.toc on some OSes
theres still the problem that gnu decided not to make libc.so => libc.so.6 so it wont work on openbsd @ compile time without a bit of tweaking :(
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');
};