summaryrefslogtreecommitdiff
path: root/libjava/interpret.cc
diff options
context:
space:
mode:
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-01 10:46:36 +0000
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-01 10:46:36 +0000
commit60793b98ef6e646ea52016ec2f2bad5b7bcda582 (patch)
tree97d7fe8daa62f82f0826e2248f98c24d3f5d02a4 /libjava/interpret.cc
parent69202565df8ed0f95df9ca6e3ec1bf946ac88f6d (diff)
downloadgcc-60793b98ef6e646ea52016ec2f2bad5b7bcda582.tar.gz
PR target/51500
* interpret.cc (_Jv_init_cif): Handle thiscall convention for 32-bit Windows. * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Likewise. * java/lang/reflect/natVMProxy.cc (invoke_t): Add thiscall-attribute for 32-bit Windows. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183794 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/interpret.cc')
-rw-r--r--libjava/interpret.cc7
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");