]> gcc.gnu.org Git - gcc.git/commitdiff
prims.cc (_JNI_OnLoad): New function.
authorRainer Orth <ro@TechFak.Uni-Bielefeld.DE>
Tue, 24 Jul 2001 20:08:58 +0000 (20:08 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Tue, 24 Jul 2001 20:08:58 +0000 (20:08 +0000)
* prims.cc (_JNI_OnLoad): New function.
(JNI_OnLoad): Use it.
(_Jv_CreateJavaVM): Check for _JNI_OnLoad, not NULL.

From-SVN: r44316

libjava/ChangeLog
libjava/prims.cc

index 1f178b199ef1dc45df919f8c33e8b85a40d2bb0c..dc779d13d32c288a8f8cfb3c9d7ea644afe69f05 100644 (file)
@@ -1,3 +1,9 @@
+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.
index eac47e5fee56f696db29643195c9ccc68e8e940f..f10497e7a9dc6acc4a560fe0b4c696ca1675deed 100644 (file)
@@ -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)
This page took 0.067358 seconds and 5 git commands to generate.