Don't define JNI_OnLoad in libjava/gnu/gcj/runtime/natFirstThread.cc on cygwin

Billinghurst, David (CRTS) David.Billinghurst@riotinto.com
Sun Apr 22 00:23:00 GMT 2001


cygwin doesn't support weak symbols. This work around gets us going. 
2001年04月22日 David Billinghurst <David.Billinghurst@riotinto.com>
	* gnu/gcj/runtime/natFirstThread.cc: Avoid JNI_OnLoad for cygwin
Index: natFirstThread.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/gcj/runtime/natFirstThread.cc,v
retrieving revision 1.5
diff -u -r1.5 natFirstThread.cc
--- natFirstThread.cc	2001年03月26日 07:05:32	1.5
+++ natFirstThread.cc	2001年04月22日 07:17:23
@@ -37,6 +37,7 @@
 extern void (*_Jv_JVMPI_Notify_THREAD_START) (JVMPI_Event *event);
 #endif
 
+#ifndef __CYGWIN__
 /* This will be non-NULL if the user has preloaded a JNI library, or
 linked one into the executable. */
 extern "C" 
@@ -44,6 +45,7 @@
 #pragma weak JNI_OnLoad
 extern jint JNI_OnLoad (JavaVM *, void *) __attribute__((weak));
 }
+#endif /* __CYGWIN__ */
 
 void
 gnu::gcj::runtime::FirstThread::run (void)
@@ -57,6 +59,7 @@
 environment variable. We take advatage of this here to allow for
 dynamically loading a JNI library into a fully linked executable. */
 
+#ifndef __CYGWIN__
 if (JNI_OnLoad != NULL)
 {
 JavaVM *vm = _Jv_GetJavaVM ();
@@ -72,6 +75,7 @@
 	 throw new java::lang::UnsatisfiedLinkError (JvNewStringLatin1
("unrecognized version from preloaded JNI_OnLoad"));
 	}
 }
+#endif __CYGWIN__
 
 if (klass == NULL)
 klass = java::lang::Class::forName (klass_name);


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /