Menu

#26 FFI: passing structs by value

None
open
FFI (2)
4
2017-12-26
2006-05-11
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
     
  • Bruno Haible

    Bruno Haible - 2017-12-26
    • Group: -->
    • Priority: 5 --> 4
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.