FFI: c/c++ struct on stack as an argument or return value

Sergei Trofimovich slyich at gmail.com
Wed Mar 19 07:45:36 UTC 2014


On Tue, 18 Mar 2014 20:31:19 +0300
Yuras Shumovich <shumovichy at gmail.com> wrote:

> Hi,
> 
> I thought I have lost the battle :)
> Thank you for the support, Simon!
> 
> I'm interested in full featured solution: arguments, return value,
> foreign import, foreign export, etc. But it is too much for me to do it
> all at once. So I started with dynamic wrapper.
> 
> The plan is to support structs as arguments and return value for dynamic
> wrapper using libffi;
> then implement native adjustors at least for x86_64 linux;

On a positive side there is only 2 arches supporting native adjustors
that actually work these days:

ArchHasAdjustorSupport = $(if $(findstring $(TargetArch_CPP),i386 x86_64),YES,NO)

> then make final design decision (tuple or data? language pragma? union
> support? etc);
> and only then start working on foreign import. 
> 
> But I'm open for suggestions. Just let me know if you think it is better
> to start with return value support for foreign import. 
> 
> Thanks,
> Yuras

-- 

  Sergei
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20140319/b9e09bd5/attachment.sig>


More information about the ghc-devs mailing list