From 74ee27eff3f29f07896a7f55b64ad2922dda7018 Mon Sep 17 00:00:00 2001 From: tromey Date: Fri, 18 Feb 2000 21:22:06 +0000 Subject: * include/jvm.h (_Jv_GetJavaVM): Declare. * include/java-interp.h (_Jv_GetFirstMethod): New function. (_Jv_MethodBase::get_method): New method. (_Jv_JNIMethod::set_function): New method. * jni.cc (_Jv_JNI_UnregisterNatives): New function. (_Jv_JNI_RegisterNatives): New function. (_Jv_JNIFunctions): Updated for new functions. (_Jv_GetJavaVM): New function. (_Jv_JNI_GetJavaVM): Use it. Now static. (_Jv_JNI_AttachCurrentThread): Create a new JNIEnv if this thread is already a Java thread but does not have a JNIEnv yet. * java/lang/natRuntime.cc (_load): Pass the JavaVM to the onload function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32056 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/java/lang/natRuntime.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'libjava/java/lang/natRuntime.cc') diff --git a/libjava/java/lang/natRuntime.cc b/libjava/java/lang/natRuntime.cc index b9b9c57365a..eb1d477002a 100644 --- a/libjava/java/lang/natRuntime.cc +++ b/libjava/java/lang/natRuntime.cc @@ -135,8 +135,13 @@ java::lang::Runtime::_load (jstring path, jboolean do_search) void *onload = lt_dlsym (h, "JNI_OnLoad"); if (onload != NULL) { - // FIXME: need invocation API to get JavaVM. - jint vers = ((jint (*) (...)) onload) (NULL, NULL); + JavaVM *vm = _Jv_GetJavaVM (); + if (vm == NULL) + { + // FIXME: what? + return; + } + jint vers = ((jint (*) (JavaVM *, void *)) onload) (vm, NULL); if (vers != JNI_VERSION_1_1 && vers != JNI_VERSION_1_2) { // FIXME: unload the library. -- cgit v1.2.1