[cffi-devel] Progress report: week (- t 5)

Cliff Yapp cliffyapp at cox.net
Tue Jul 26 13:57:36 UTC 2005


On Monday 25 July 2005 23:17, Luis Oliveira wrote:

> ===
> Calling conventions
>
> If I understand correctly, wrt C, the only calling convention issue is
> between 'cdecl' and 'stdcall' on win32. I suppose it would be nice not
> being required to specify this. (UFFI doesn't support stdcall at all).
>
> Anyway, I noticed that Allegro doesn't require specifying cdecl vs.
> stdcall. I mailed Duane who quickly replied and explained to me that
> Allegro saves the stack pointer, and resets it after the call returns.
> That way, it'll work the same way whether it's the caller or the callee
> who is supposed to remove the arguments from the stack.
>
> Do we want to add a new option to decfun for specifying the calling
> convention or do we want to convince/help the windows lisps to behave
> like Allegro? I think the Allegro approach is much better, and allows
> for more portable code between windows and unix.

I'm thinking the better thing to do here would be to work with the windows
lisps - Camm at GCL <camm at enhanced.com>  is always 
open to suggestions and will undoubtedly be delighted to hear you are 
working on a GCL port.  I know less about Clisp's crew,  but I think Sam 
Steingold <sds at gnu.org> is probably the man to talk to about that.  ECL
http://ecls.sourceforge.net/ also apparently works on Windows, and might
be a very interesting test case as it a) compiles with the free Microsoft 
Visual C++ toolkit and b) has some sort of FFI based bridge to the Windows
GUI libraries:

2005-06-08 04:41  Michael Goffioul has contributed a library for calling 
Microsoft Windows's GUI functions from ECL. The library uses ECL's own 
implementation of the UFFI (Unified Foreign Function Interface) and 
demonstrates that this is really usable. As examples, he has written both the 
typical button example and a small, single window text editor. You can find a 
screenshot at the project homepage 
(https://sourceforge.net/project/screenshots.php?group_id=30035)

I don't know of any others offhand, but I would definitely advocate a) the 
Right approach and b) more portable code between Windows and unix.
b) especially would be a Big Win.

Very exciting stuff!

Cheers,
CY



More information about the cffi-devel mailing list