Hi Aidan, Aidan Gauland <aidal...@no8wireless.co.nz> writes:
> On Tue, Mar 08, 2011 at 08:20:29PM +1300, Aidan Gauland wrote: >> (parse-c-struct event-pointer >> (list uint8 uint8 uint8 >> (list uint8 int int uint16 ))) >> > > It seemed to be an off-by-one(-byte) error. There was padding to > align (to 32-bits, I think) the sub-struct. > > This works on my 32-bit machine, but I suspect it is not portable. > > (parse-c-struct event-pointer > (list uint8 uint8 uint8 uint8 ; Padding > (list uint8 int int uint16 ))) > > What would be a better, portable solution? I suspect the `alignof' > procedure is my friend here, but I don't understand how to use it. The ‘alignof’ procedure was actually your enemy here. ;-) This patch should fix it (will be in 2.0.1): http://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=d82f8518b96bbfa4f29e03d922369c37b64824d9 Thanks! Ludo’. PS: Let us know when your game is ready. :-)