diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-03-11 11:09:23 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-03-11 11:09:23 -0400 |
commit | 4147b72ee33d6aa3aae1154017679cdf0f304c61 (patch) | |
tree | 3fb1d1e141e8a224a0dc4a9eeaa259042daf1938 | |
parent | 0469df66bd9c907b7a90241ab8ed7eb716d7f700 (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 :(
-rw-r--r-- | std/io.toc | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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'); }; |