This is the mail archive of the libffi-discuss@sources.redhat.com mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libffi on win32


Eli Barzilay <eli@barzilay.org> writes:

> Hi,
>
> We have now a working ffi interface for our project language, which
> works very well on Unix platforms (linux, osx, solaris).  We're now at
> the happy stage of making it all work on Windows...  The question is
> -- how is it possible to do this on Windows?  AFAICT, it looks like it
> would be easier to do with cygwin, but we have an MSVC build of the
> language -- will a library that is compiled with cygwing work with an
> MSVC application?  If not, then we want to start hacking things on
> windows so it works with MSVC.  Is there any work done for that?  I've
> also seen that Thomas Heller said that he some compatible home-grown
> package for Windows -- can that be used as a drop-in replacement for
> libffi?

I'm in the process of moving my package (ctypes) to a hacked version of
libffi.  It's 99% done, I just need some more time to find and fix the
remaining bugs.

<http://cvs.sourceforge.net/viewcvs.py/ctypes/ctypes/source/libffi_msvc/>

Note that the files win32.S and types.c in this directory are not used
any longer.  win32.S has been replaced by win32.c, which contains MSVC
assembler, and types.c is (somewhat) replaced by the last part of the
code in
<http://cvs.sourceforge.net/viewcvs.py/ctypes/ctypes/source/cfield.c?view=markup>

I have made a few changes to libffi, the most important is that
ffi_call_SYSV() and ffi_call_STDCALL() return an integer now, that is
the delta of the stack pointer before and after the call.  This result
should be zero, otherwise either the calling convention or the number of
parameter (bytes) in the function call is not correct.  I need this info
for my package.

Thomas


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]