[Larceny-users] c union

Felix Klock felixluser at pnkfx.org
Tue Mar 3 13:56:20 EST 2009


Ed (cc'ing larceny-users)-

On Feb 28, 2009, at 5:50 PM, Eduardo Cavazos wrote:

>> What's the proper way to specify a C union using the FFI?
>
> My workaround for now was to just do a sizeof on the union and define:
>
>     (define make-XYX (make-bytevector the-size-of-XYZ))

This is best current option I can think of.

----

Of course the above is not helpful when the C union is itself a  
function parameter (as opposed to a pointer to the union).  The  
current Larceny FFI does not attempt to address that case directly.

The Larceny FFI is also missing arbitrary struct parameters; adding  
the latter does not seem trivial to me, so we have been trying to get  
by without it.

-Felix





More information about the Larceny-users mailing list