diff options
Diffstat (limited to 'libjava/interpret.cc')
-rw-r--r-- | libjava/interpret.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libjava/interpret.cc b/libjava/interpret.cc index ab28836293e..78686fd55b7 100644 --- a/libjava/interpret.cc +++ b/libjava/interpret.cc @@ -1303,7 +1303,12 @@ _Jv_init_cif (_Jv_Utf8Const* signature, if (ptr != (unsigned char*)signature->chars() + signature->len()) throw_internal_error ("did not find end of signature"); - if (ffi_prep_cif (cif, FFI_DEFAULT_ABI, + ffi_abi cabi = FFI_DEFAULT_ABI; +#if defined (X86_WIN32) && !defined (__CYGWIN__) + if (!staticp) + cabi = FFI_THISCALL; +#endif + if (ffi_prep_cif (cif, cabi, arg_count, rtype, arg_types) != FFI_OK) throw_internal_error ("ffi_prep_cif failed"); |