Commit edd60b15 by Rainer Orth Committed by Rainer Orth

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
parent 6e6958dc
2001-07-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> 2001-07-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* prims.cc (_JNI_OnLoad): New function.
(JNI_OnLoad): Use it.
(_Jv_CreateJavaVM): Check for _JNI_OnLoad, not NULL.
2001-07-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* Makefile.am (AM_MAKEFLAGS): Pass RUNTESTFLAGS. * Makefile.am (AM_MAKEFLAGS): Pass RUNTESTFLAGS.
Makefile.in: Regenerate. Makefile.in: Regenerate.
......
...@@ -690,12 +690,19 @@ win32_exception_handler (LPEXCEPTION_POINTERS e) ...@@ -690,12 +690,19 @@ win32_exception_handler (LPEXCEPTION_POINTERS e)
#endif #endif
/* This will be non-NULL if the user has preloaded a JNI library, or /* This will be different from _JNI_OnLoad if the user has preloaded a JNI
linked one into the executable. */ library, or linked one into the executable. */
extern "C" 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)); 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*/) ...@@ -895,7 +902,7 @@ _Jv_CreateJavaVM (void* /*vm_args*/)
environment variable. We take advatage of this here to allow for environment variable. We take advatage of this here to allow for
dynamically loading a JNI library into a fully linked executable. */ dynamically loading a JNI library into a fully linked executable. */
if (JNI_OnLoad != NULL) if (JNI_OnLoad != _JNI_OnLoad)
{ {
JavaVM *vm = _Jv_GetJavaVM (); JavaVM *vm = _Jv_GetJavaVM ();
if (vm == NULL) if (vm == NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment