fixed pointer argument handling issues when interfacing with libffi in mod/ffi.c

This commit is contained in:
hyunghwan.chung
2019-08-10 04:08:49 +00:00
parent 70c97f5ab5
commit 85eae9e78b
3 changed files with 76 additions and 26 deletions

View File

@ -210,3 +210,14 @@ what looks better as a shorthand expression for block value?
a->()? block value?
```
### FFI
```
ffi := FFI new: 'libc.so.6'.
(ffi call: #printf signature: 's|sl>i' arguments: #("[%s ffi test %ld]\n" "sloppy" 12345678)) dump.
(ffi call: #printf signature: 's>i' arguments: #("[%% ffi test %%]\n")) dump.
(ffi call: #puts signature: 's>i' arguments: #("this is ffi test")) dump.
(ffi call: #time signature: 'p>l' arguments: #(#\p0)) dump.
ffi close.
```