#26 FFI: passing structs by value

open
Jörg Höhle
FFI (2)
5
2006-09-26
2006-05-11
Sam Steingold
No

http://clisp.cons.org/impnotes/dffi.html#ffi-struct-arg:
Passing FFI:C-STRUCT, FFI:C-UNION, FFI:C-ARRAY,
FFI:C-ARRAY-MAX values as arguments (not via pointers)
is only possible to the extent the C compiler supports
it. Most C compilers do it right, but some C compilers
(such as gcc on hppa and Win32) have problems with
this. The recommended workaround is to pass pointers;
this is fully supported

foreign.d should signal an error
when a struct is passed by value
foreign1.lisp should emit C code for a wrapper function
that passes the struct by pointer
http://article.gmane.org/gmane.lisp.clisp.general:11075

Discussion

  • Sam Steingold
    Sam Steingold
    2006-09-26

    • labels: --> FFI