lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Fri, Jun 22, 2012 at 6:43 PM, Miles Bader <> wrote:
It also occurred to me that while there are probably many parts of FFI
which could be made more portable, there are some important operations
which are simply impossible to do portably at runtime in standard C.

The unportable bits are:
1. argument -> register/stack mapping - requires assembly and non portable JITer
2. vaarg -> stack mapping - done mostly in C
3. bitfields - done in C, but these are a portability nightmare. Basically no documentation, in the end I wrote up a unit test that just about tries every case to see what a particular compiler feels like giving me and then deciphering the rules/bugs from that.
4. function mangling
5. base DLLs
6. getting errors (errno vs Get/SetLastError)
7. how to load DLLs and lookup functions

-- James