aboutsummaryrefslogtreecommitdiff
path: root/libjava/resolve.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/resolve.cc')
-rw-r--r--libjava/resolve.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/libjava/resolve.cc b/libjava/resolve.cc
index e69341e..aa17ea9 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");