[fetter-devel] gccxml-config and virtual-funcall on the mac

Attila Lendvai attila.lendvai at gmail.com
Mon Nov 12 09:16:58 UTC 2007


> My current environment is SBCL, OS X, x86, gcc; with gccxml 0.7.0, cffi
> 0.9.2, and the darcs head revision of verrazano as of a couple of days ago.


i've only used it with gccxml cvs HEAD, no idea about other versions.


> 2. The next thing I noticed was that my test bindings would not load without
> errors.  The problem was in the use of VIRTUAL-FUNCALL.  It seems that CFFI
> has changed FOREIGN-FUNCALL and added FOREIGN-FUNCALL-POINTER.  After a
> little reading of the CFFI source, I came up with the following -- which
> seems to work but is by no means well-tested or well-understood:
>
>
> (defmacro virtual-funcall (pobj indx coff &body body)
>   `(foreign-funcall-pointer (vtable-lookup ,pobj ,indx ,coff) nil , at body))


the virtual funcall stuff is bitrotten (it was written back when even
CFFI had a different interface) and was only a proof of concept even
at its shiny days. the problem is that the vtable stuff is potentially
different for each compiler kind and version. therefore it's kinda
pointless to try creating an abstraction layer in verrazano. what
should be done (imho) is to create some code in verrazano that can
automatically generate C wrapper code around the needed C++
interfaces, then compile that and use it as a plain C lib. cffi-grovel
should be studied to avoid code duplication.

see the mail archives for details, there was a discussion about it recently.

i think we should even drop verrazano-runtime that only exists for the
vtable stuff. what do you think? if noone speaks up for long enough
i'll have it on my todo and do it eventually.

hth,

-- 
 attila



More information about the fetter-devel mailing list