summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-03 21:07:22 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-03 21:07:22 +0000
commit48831167e2e28fb95355c426dcd700f74b32a1c9 (patch)
treeb2f1f01798e273a0b7aac27bb966493109f23ab3
parentbef09eef0b9585c3ad262cd7a609c0dd78049d4e (diff)
downloadgcc-48831167e2e28fb95355c426dcd700f74b32a1c9.tar.gz
2003-02-03 Ranjit Mathew <rmathew@hotmail.com>
* resolve.cc (_Jv_JNIMethod::ncode): Use stdcall calling convention on Win32 to invoke native JNI methods. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62345 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libjava/ChangeLog5
-rw-r--r--libjava/resolve.cc9
2 files changed, 13 insertions, 1 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 72c1793479d..11ba2edd366 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,8 @@
+2003-02-03 Ranjit Mathew <rmathew@hotmail.com>
+
+ * resolve.cc (_Jv_JNIMethod::ncode): Use stdcall calling
+ convention on Win32 to invoke native JNI methods.
+
2003-02-03 Andrew Haley <aph@redhat.com>
* configure.host (x86_64): Enable interpreter.
diff --git a/libjava/resolve.cc b/libjava/resolve.cc
index e69341e385f..aa17ea9c5f0 100644
--- a/libjava/resolve.cc
+++ b/libjava/resolve.cc
@@ -1003,7 +1003,14 @@ _Jv_JNIMethod::ncode ()
memcpy (&jni_arg_types[offset], &closure->arg_types[0],
arg_count * sizeof (ffi_type *));
- if (ffi_prep_cif (&jni_cif, FFI_DEFAULT_ABI,
+ // NOTE: This must agree with the JNICALL definition in jni.h
+#ifdef WIN32
+#define FFI_JNI_ABI FFI_STDCALL
+#else
+#define FFI_JNI_ABI FFI_DEFAULT_ABI
+#endif
+
+ if (ffi_prep_cif (&jni_cif, FFI_JNI_ABI,
extra_args + arg_count, rtype,
jni_arg_types) != FFI_OK)
throw_internal_error ("ffi_prep_cif failed for JNI function");