From 4147b72ee33d6aa3aae1154017679cdf0f304c61 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Wed, 11 Mar 2020 11:09:23 -0400 Subject: 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 :( --- std/io.toc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'std') 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'); }; -- cgit v1.2.3