From: Sylvain Joyeux Date: 2008-11-04T17:30:09+09:00 Subject: Re: [ANN] FFI 0.1.1 (Foreign Function Interface) for Ruby 1.8.6/7 and 1.9 On Tue, Nov 04, 2008 at 06:45:27AM +0900, Charles Oliver Nutter wrote: > Sylvain Joyeux wrote: >> On Tue, Nov 04, 2008 at 04:54:35AM +0900, Charles Oliver Nutter wrote: >>> Charles Oliver Nutter wrote: >>>> Charles Oliver Nutter wrote: >>>>> We (JRuby and Rubinius contributors) designed in the ability to >>>>> specify calling convention for a given library bound through FFI. >>>>> Largely this was needed to support Win32's stdcall, but if >>>>> Linux/PPC has a different convention and libffi supports it, >>>>> then FFi will too (though we may have to add it to the list of >>>>> accepted conventions). >>>>> >>>>> I'll check on the syntax we're supporting and get back to ya. >>>> In the body of the module you're binding: >>>> >>>> ffi_convention :stdcall # :default is for normal C convention >>>> >>>> We could add whatever convention Linux/PPC needs. >>> Or, duh, have FFI use the appropriate default convention on the >>> target platform. Either way, it should be simple to deal with. >> >> Thanks Charlie, but I have already my own library which does more than Ruby-FFI >> (typelib.sf.net and typelib.sf.net/html/ruby) so I'll probably be using libffi >> directly. > > Is your library compatible with JRuby? I think that's a key point for > Ruby FFI. It is not -- it is mainly C++ -- but given that most of the functionality is written in C++ *and* I use that C++ interface in other C++ programs, moving to Ruby-FFI is not practical for me. So ... Sylvain