diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-03-01 12:08:28 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-03-01 12:08:28 -0500 |
commit | da748748c0239c21b9d62c77b51e269ad1d7de9f (patch) | |
tree | 2e546d3d370cb0aeea7fe24e653c9a456ec614b7 /std | |
parent | 7cced2c313c94d1fb8736581840dff00708aabf1 (diff) |
better #foreign system
Diffstat (limited to 'std')
-rw-r--r-- | std/io.toc | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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")); |