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

Luis Oliveira luismbo at gmail.com
Tue Jul 26 16:25:57 UTC 2005


On 26/jul/2005, at 14:34, C Y wrote:
>> 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.
<snip>
>  2005-06-08 04:41  Michael Goffioul has contributed a library for 
> calling
>  Microsoft Windows's GUI functions from ECL.

I took a look at those bindings and I see it uses C-LINES to #include 
windows.h. I suppose that's what lets ECL (well, GCC or whatever) know 
whether to use stdcall or cdedcl. I'm not sure if the Allegro approach 
is easy/desirable for ECL (and GCL). Perhaps Juanjo can offer some 
insight on this.


>  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.

Another solution would be to define a calling convention globally 
(clisp has this too) then one could do something like this:

   #+win32 (set-default-calling-convention :stdcall)
   #-win32 (set-default-calling-convention :c)

CLISP might have issues here though, since I suppose this could make 
its fasls unportable across platforms. (another reason to push the 
Allegro approach).

I guess that if we decide to try the Allegro approach, windows Lisps 
that don't support this yet could simply default to cdecl (that's what 
UFFI does atm anyway).

-- 
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/
Equipa Portuguesa do Translation Project
http://www2.iro.umontreal.ca/~pinard/po/registry.cgi?team=pt




More information about the cffi-devel mailing list