64-bit Windows already used this check; make it universal, and use it in
place of an ifdef on X86_WIN32, to handle non-Windows platforms that use
the underscore, such as Darwin.
When sizeof(size_t) != sizeof(unsigned), adding a size_t to cif->bytes
produces a "possible loss of data" warning. However, the size_t in
question refers to the size of a single parameter. Use a cast to avoid
the warning.
Newer versions of Darwin generate the necessary stub functions
automatically and just need a call instruction, but accomodating older
versions as well requires adding the stub.
Now that non-Windows platforms include win32.S, it needs to support
building as position-independent code. This fixes build failures on
target platforms that do not allow text relocations.
Now that non-Windows platforms include win32.S, it needs to support
building as position-independent code. This fixes one source of build
failures on target platforms that do not allow text relocations.
* Don't try to mix incompatible optimization flags in debug builds.
* Workaround ax_cc_maxopt.m4 not supporting MSVC and change -O3 to -O2.
* Fix MSVC warning by properly passing linker flags to compiler.
* Make msvcc.sh return 1 if invalid command line options are used rather than silently eating them.
* Add more comments.
This eliminates all the *_win32.c tests in favor of the tests they were
branched from, and expands test coverage to run many more tests on
stdcall, thiscall, and fastcall.
This same mechanism also supports testing any other target that has
multiple ABIs.
This commons up code from libffi.call/call.exp and
libffi.special/special.exp, unifies the optimization option matrix
between the two, and makes it easier to add more axes to the matrix
in the future.
This was originally done in PR #84, except the change was made to Makefile.in instead of Makefile.am and was therefore reverted the next time the files were regenerated.
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.
ffi_prep_cif_core had a special case for X86_WIN32, checking for
FFI_THISCALL in addition to the FFI_FIRST_ABI-to-FFI_LAST_ABI range
before returning FFI_BAD_ABI. However, on X86_WIN32, FFI_THISCALL
already falls in that range, making the special case unnecessary.
Remove it.