Hello,
About the struct alignment issue, I found some docs here: http://refspecs.freestandards.org/ and fixed the bug following the instructions in "System V Application Binary Interface Intel386 Architecture Processor Supplment, Fourth Edition". According to the other ABI docs under "Processor Specific ELF documents" the same rules apply at least for x86-64, MIPS and PowerPC.
These documents mention System V, so I suppose it could be different for other systems. I have tested this under Win32 and MacOS X (as well as Linux) and they seem to use the same rules.
So anyway, these are the new changes in cffi-luis:
Fri Sep 2 08:57:50 WEST 2005 Luis Oliveira loliveira@common-lisp.net * CFFI User Manual update.
Fri Sep 2 05:40:50 WEST 2005 Luis Oliveira loliveira@common-lisp.net * Fix struct bug, defcvar bug and tweaked bindings.lisp
- defcvar now works (more) correctly with aggregate types. - struct types now carry alignment information which is now correctly calculated (for unions too) according to the x86 ABI (tested on darwin/ppc too, but should study other ABI docs at some point). - also tail padding is now correctly added to structs, when necessary. (also according to the x86 ABI). - 4 new tests for this struct bug (reported by Wilco Greven). - tweaked tests/bindings.lisp to correctly load the library on Lispworks and to make it more portable across win/nix/etc..
Thu Sep 1 08:36:04 WEST 2005 Luis Oliveira loliveira@common-lisp.net * Slight change to defcenum to make Corman Lisp happier.
Wed Aug 31 07:46:45 WEST 2005 Luis Oliveira loliveira@common-lisp.net * Well, lets support MINGW too. Tweaked the Makefile a bit to support MINGW too.
Wed Aug 31 07:30:13 WEST 2005 Luis Oliveira loliveira@common-lisp.net * Win32 tweaks to the test library...
... in order to work with the MSVC++ free toolkit.
- correctly load the test library. - and __declspec(dllexport) to the test library functions - implement a strdup, used in 2 tests - added a compile.bat, the free toolkit doesn't seem to have nmake. Also, I don't know how to make ASDF automatically compile the lib under win32 like I did for *nix.