[gambit-list] C-FFI type issues

Darren Baker darren at wildfire.com.au
Thu Sep 17 00:41:03 EDT 2009


Hi,

Is it the binding for clip_rect?  It looks like you're trying to assign 
a struct value type to pointer ___result_voidstar

You either want to allocate storage for a copy of the struct and use a 
release function (per the c-lambda docs in the Gambit manual), or just 
use pointers, eg:

(define SDL_Surface.clip_rect
    (c-lambda
     ((pointer "SDL_Surface"))
     (pointer (struct "SDL_Rect"))
     "___result_voidstar = &___arg1->clip_rect;"))
)

Of course if you do this you have to be careful managing the lifetime of 
the containing object so you don't get dangling pointers etc.

Hope that helps.

Darren


Isaac Freeman wrote:
> I've been banging my head on this one for days now... I've even tried
> looking at the resulting C code and passing it through the CPP and
> indent... I can't figure out where this is complaining about and
> why...
>
> http://paste.lisp.org/display/87211
>
> Any hints would be great...
>
>   




More information about the Gambit-list mailing list