[kaffe] CVS kaffe (robilad): Cross-compilation fix for jni
Kaffe CVS
cvs-commits at kaffe.org
Sun Mar 13 15:28:08 PST 2005
PatchSet 5560
Date: 2005/03/13 23:23:46
Author: robilad
Branch: HEAD
Tag: (none)
Log:
Cross-compilation fix for jni
2005-03-13 Dalibor Topic <robilad at kaffe.org>
* kaffe/kaffevm/external.c,
kaffe/kaffevm/jni/jni-base.c:
Replaced use of Kaffe_JavaVM by KaffeJNI_GetKaffeVM.
* kaffe/kaffevm/jni/jni.c
(Kaffe_JavaVM) Made static.
(KaffeJNI_GetKaffeVM): New function.
* kaffe/kaffevm/jni/jni_i.h
(KaffeJNI_GetKaffeVM) New prototype.
Members:
ChangeLog:1.3734->1.3735
kaffe/kaffevm/external.c:1.79->1.80
kaffe/kaffevm/jni/jni-base.c:1.15->1.16
kaffe/kaffevm/jni/jni.c:1.19->1.20
kaffe/kaffevm/jni/jni_i.h:1.7->1.8
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3734 kaffe/ChangeLog:1.3735
--- kaffe/ChangeLog:1.3734 Sun Mar 13 22:21:04 2005
+++ kaffe/ChangeLog Sun Mar 13 23:23:46 2005
@@ -1,5 +1,18 @@
2005-03-13 Dalibor Topic <robilad at kaffe.org>
+ * kaffe/kaffevm/external.c,
+ kaffe/kaffevm/jni/jni-base.c:
+ Replaced use of Kaffe_JavaVM by KaffeJNI_GetKaffeVM.
+
+ * kaffe/kaffevm/jni/jni.c
+ (Kaffe_JavaVM) Made static.
+ (KaffeJNI_GetKaffeVM): New function.
+
+ * kaffe/kaffevm/jni/jni_i.h
+ (KaffeJNI_GetKaffeVM) New prototype.
+
+2005-03-13 Dalibor Topic <robilad at kaffe.org>
+
* kaffe/kaffevm/systems/unix-pthreads/thread-impl.c:
(systemMutex) Made static.
Index: kaffe/kaffe/kaffevm/external.c
diff -u kaffe/kaffe/kaffevm/external.c:1.79 kaffe/kaffe/kaffevm/external.c:1.80
--- kaffe/kaffe/kaffevm/external.c:1.79 Fri Mar 11 16:41:52 2005
+++ kaffe/kaffe/kaffevm/external.c Sun Mar 13 23:23:46 2005
@@ -75,8 +75,6 @@
static iStaticLock libraryLock; /* mutex on all intern operations */
static char *libraryPath = NULL;
-extern JavaVM Kaffe_JavaVM;
-
#ifdef ENABLE_BINRELOC
static
const char *discoverLibraryHome(void)
@@ -295,7 +293,7 @@
func = loadNativeLibrarySym("JNI_OnLoad");
if (func != NULL) {
- JavaVM *jvm = &Kaffe_JavaVM;
+ JavaVM *jvm = KaffeJNI_GetKaffeVM();
/* Call JNI_OnLoad */
((jint(JNICALL *)(JavaVM *, void *))func)(jvm, NULL);
}
Index: kaffe/kaffe/kaffevm/jni/jni-base.c
diff -u kaffe/kaffe/kaffevm/jni/jni-base.c:1.15 kaffe/kaffe/kaffevm/jni/jni-base.c:1.16
--- kaffe/kaffe/kaffevm/jni/jni-base.c:1.15 Sat Mar 12 21:22:40 2005
+++ kaffe/kaffe/kaffevm/jni/jni-base.c Sun Mar 13 23:23:47 2005
@@ -36,7 +36,6 @@
extern struct JNINativeInterface Kaffe_JNINativeInterface;
extern KaffeVM_Arguments Kaffe_JavaVMInitArgs;
-extern JavaVM Kaffe_JavaVM;
jint
JNI_GetDefaultJavaVMInitArgs(void* args)
@@ -302,7 +301,7 @@
THREAD_DATA()->jnireferences = reftable;
/* Return the VM and JNI we're using */
- *vm = &Kaffe_JavaVM;
+ *vm = KaffeJNI_GetKaffeVM();
*env = THREAD_JNIENV();
startingThread = KTHREAD(current)();
Kaffe_NumVM++;
@@ -336,7 +335,7 @@
jint
JNI_GetCreatedJavaVMs(JavaVM** vm, jsize buflen UNUSED, jsize* nvm)
{
- vm[0] = &Kaffe_JavaVM;
+ vm[0] = KaffeJNI_GetKaffeVM();
*nvm = Kaffe_NumVM;
return (0);
Index: kaffe/kaffe/kaffevm/jni/jni.c
diff -u kaffe/kaffe/kaffevm/jni/jni.c:1.19 kaffe/kaffe/kaffevm/jni/jni.c:1.20
--- kaffe/kaffe/kaffevm/jni/jni.c:1.19 Sat Mar 12 21:22:40 2005
+++ kaffe/kaffe/kaffevm/jni/jni.c Sun Mar 13 23:23:47 2005
@@ -44,7 +44,13 @@
extern struct JNINativeInterface Kaffe_JNINativeInterface;
extern KaffeVM_Arguments Kaffe_JavaVMInitArgs;
-extern JavaVM Kaffe_JavaVM;
+static JavaVM Kaffe_JavaVM;
+
+JavaVM*
+KaffeJNI_GetKaffeVM(void)
+{
+ return &Kaffe_JavaVM;
+}
static jint Kaffe_GetVersion(JNIEnv*);
static jclass Kaffe_FindClass(JNIEnv*, const char*);
@@ -728,6 +734,13 @@
/*
* Functions past this point don't bother with jni exceptions.
*/
+
+JavaVM*
+Kaffe_GetKaffeVM(void)
+{
+ return &Kaffe_JavaVM;
+}
+
static jint
Kaffe_GetJavaVM(JNIEnv* env UNUSED, JavaVM** vm)
{
@@ -1070,7 +1083,7 @@
/*
* Setup the Kaffe VM.
*/
-JavaVM Kaffe_JavaVM = {
+static JavaVM Kaffe_JavaVM = {
&Kaffe_JNIInvokeInterface,
};
Index: kaffe/kaffe/kaffevm/jni/jni_i.h
diff -u kaffe/kaffe/kaffevm/jni/jni_i.h:1.7 kaffe/kaffe/kaffevm/jni/jni_i.h:1.8
--- kaffe/kaffe/kaffevm/jni/jni_i.h:1.7 Fri Feb 4 10:36:15 2005
+++ kaffe/kaffe/kaffevm/jni/jni_i.h Sun Mar 13 23:23:47 2005
@@ -9,6 +9,8 @@
#include "exception.h"
#include "md.h"
+extern JavaVM* KaffeJNI_GetKaffeVM(void);
+
#define KAFFE_VM_ENV(env) ((KaffeVM_Environment *) (((JNIEnv *)(env)) + 1))
/*
More information about the kaffe
mailing list