From: Rainer Orth Date: Tue, 24 Jul 2001 20:08:58 +0000 (+0000) Subject: prims.cc (_JNI_OnLoad): New function. X-Git-Tag: prereleases/libstdc++-3.0.95~3080 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edd60b15d1fe4a845c79e72c297bd81e95506858;p=thirdparty%2Fgcc.git prims.cc (_JNI_OnLoad): New function. * prims.cc (_JNI_OnLoad): New function. (JNI_OnLoad): Use it. (_Jv_CreateJavaVM): Check for _JNI_OnLoad, not NULL. From-SVN: r44316 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 1f178b199ef1..dc779d13d32c 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2001-07-24 Rainer Orth + + * prims.cc (_JNI_OnLoad): New function. + (JNI_OnLoad): Use it. + (_Jv_CreateJavaVM): Check for _JNI_OnLoad, not NULL. + 2001-07-24 Rainer Orth * Makefile.am (AM_MAKEFLAGS): Pass RUNTESTFLAGS. diff --git a/libjava/prims.cc b/libjava/prims.cc index eac47e5fee56..f10497e7a9dc 100644 --- a/libjava/prims.cc +++ b/libjava/prims.cc @@ -690,12 +690,19 @@ win32_exception_handler (LPEXCEPTION_POINTERS e) #endif -/* This will be non-NULL if the user has preloaded a JNI library, or - linked one into the executable. */ +/* This will be different from _JNI_OnLoad if the user has preloaded a JNI + library, or linked one into the executable. */ extern "C" { -#pragma weak JNI_OnLoad + /* Some systems, like Tru64 UNIX, don't support weak definitions, so use + an empty dummy function to check if the user provided his own. */ +#pragma weak JNI_OnLoad = _JNI_OnLoad extern jint JNI_OnLoad (JavaVM *, void *) __attribute__((weak)); + + jint _JNI_OnLoad (JavaVM *vm, void *) + { + return 0; + } } @@ -895,7 +902,7 @@ _Jv_CreateJavaVM (void* /*vm_args*/) environment variable. We take advatage of this here to allow for dynamically loading a JNI library into a fully linked executable. */ - if (JNI_OnLoad != NULL) + if (JNI_OnLoad != _JNI_OnLoad) { JavaVM *vm = _Jv_GetJavaVM (); if (vm == NULL)