Commit Graph

4 Commits

Author SHA1 Message Date
Josh Triplett
e1911f78df Add support for stdcall, thiscall, and fastcall on non-Windows x86-32
Linux supports the stdcall calling convention, either via functions
explicitly declared with the stdcall attribute, or via code compiled
with -mrtd which effectively makes stdcall the default.

This introduces FFI_STDCALL, FFI_THISCALL, and FFI_FASTCALL on
non-Windows x86-32 platforms, as non-default calling conventions.
2014-03-16 05:05:06 -07:00
Josh Triplett
9c279328ee testsuite: Remove fragile stack pointer checks
testsuite/libffi.call/closure_stdcall.c and
testsuite/libffi.call/closure_thiscall.c include inline assembly to save
the stack pointer before and after the call, and compare the values.
However, compilers can and do leave the stack in different states for
these two pieces of inline assembly, such as by saving a temporary value
on the stack across the call; observed with gcc -Os, and verified as
spurious through careful inspection of disassembly.
2014-03-16 04:45:37 -07:00
Peter Rosin
0a1ab12a8d Various MSVC-related changes. 2012-03-30 08:14:08 -04:00
Anthony Green
dee20f8e45 Rebased from gcc 2012-02-10 13:06:46 -05:00