summaryrefslogtreecommitdiff
path: root/std
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-03-01 12:08:28 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-03-01 12:08:28 -0500
commitda748748c0239c21b9d62c77b51e269ad1d7de9f (patch)
tree2e546d3d370cb0aeea7fe24e653c9a456ec614b7 /std
parent7cced2c313c94d1fb8736581840dff00708aabf1 (diff)
better #foreign system
Diffstat (limited to 'std')
-rw-r--r--std/io.toc4
1 files changed, 2 insertions, 2 deletions
diff --git a/std/io.toc b/std/io.toc
index fac4921..5a69269 100644
--- a/std/io.toc
+++ b/std/io.toc
@@ -17,12 +17,12 @@ get_utype_with_size ::= fn(size :: i64) Type {
c_int ::= get_type_with_size(#builtin("sizeof int"));
c_size_t ::= get_utype_with_size(#builtin("sizeof size_t"));
-c_putchar :: fn(c_int) c_int = #foreign "putchar", "libc.so.6";
+c_putchar ::= #foreign("putchar", "libc.so.6") fn(#C int) #C int;
toc_putchar ::= fn(x: char) {
c_putchar(x as c_int);
};
-c_fwrite :: fn(&u8, c_size_t, c_size_t, &u8) = #foreign "fwrite", "libc.so.6";
+c_fwrite ::= #foreign("fwrite", "libc.so.6") fn(&u8, #C size_t, #C size_t, &u8) #C size_t;
stdout_fwrite ::= fn(data: &u8, size: u64, nmemb: u64) {
c_fwrite(data, size as c_size_t, nmemb as c_size_t, #builtin("stdout"));