From 8ade47715eddea64a001e982da714b791e5e6e44 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 18 Feb 2000 21:22:06 +0000 Subject: jvm.h (_Jv_GetJavaVM): Declare. * 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. From-SVN: r32056 --- 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 b9b9c57..eb1d477 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.1