summaryrefslogtreecommitdiff
path: root/libjava/prims.cc
diff options
context:
space:
mode:
authorro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-24 20:08:58 +0000
committerro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-24 20:08:58 +0000
commitc929f1872687081b000692f04f648ddcd7dabab0 (patch)
tree73237875779300713dd1ab622cdddf291c188485 /libjava/prims.cc
parent29a54189bbfabf7bd387ac4f5d0f5de4d063b249 (diff)
downloadgcc-c929f1872687081b000692f04f648ddcd7dabab0.tar.gz
* prims.cc (_JNI_OnLoad): New function.
(JNI_OnLoad): Use it. (_Jv_CreateJavaVM): Check for _JNI_OnLoad, not NULL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44316 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/prims.cc')
-rw-r--r--libjava/prims.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/libjava/prims.cc b/libjava/prims.cc
index eac47e5fee5..f10497e7a9d 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)