[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[MIT-Scheme-devel] [PATCH] FFI: Fixing problem with groveller for struct
From: |
Matt Birkholz |
Subject: |
[MIT-Scheme-devel] [PATCH] FFI: Fixing problem with groveller for structures with typedefs. |
Date: |
Wed, 12 Dec 2012 12:01:57 -0700 |
> From: Peter Feigl <address@hidden>
> Date: Wed, 12 Dec 2012 14:05:51 +0100
>
> [...] This patch removes the "struct" from the declaration of the
> struct in grovel_struct_<name> and from the sizeof(<name>) in the
> -const.c file generated by the FFI.
I can't imagine just chopping "struct" off a type declaration (moving
it from one namespace to another!) can be the solution. Can we start
with an example?
I tried generating a shim for the API you gave and had no problem.
(typedef a (struct (x int)))
(extern (* a) test_func (arg (* a)))
There IS a problem with
(extern a test_func (arg a))
signaled by a warning "Unexpected return type: (struct (x . int))".
(It could call that an "unsupported return type", and warn about the
type of ARG too.)