diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-11-09 10:50:10 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-11-09 10:50:10 +0000 |
commit | 0251d5366e9249a70818dd608836ff5fd59ac884 (patch) | |
tree | 0adb00d4a741fb1a46a13c0422523366e7562035 /jvmaccess | |
parent | 4ff64a323668c10071c28b6a9c81987ceab1ada2 (diff) |
INTEGRATION: CWS nojava1 (1.3.42); FILE MERGED
2004/08/16 15:20:48 cmc 1.3.42.2: #i33045# use normal -DSOLAR_JAVA
2004/08/16 14:21:41 cmc 1.3.42.1: #i33045# build jvmaccess even without java, just default to failure on javarelated stuff
Diffstat (limited to 'jvmaccess')
-rw-r--r-- | jvmaccess/source/virtualmachine.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/jvmaccess/source/virtualmachine.cxx b/jvmaccess/source/virtualmachine.cxx index f2a2e9a0fbc7..cc112fe040fd 100644 --- a/jvmaccess/source/virtualmachine.cxx +++ b/jvmaccess/source/virtualmachine.cxx @@ -2,9 +2,9 @@ * * $RCSfile: virtualmachine.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: obo $ $Date: 2003-09-04 11:40:56 $ + * last change: $Author: hr $ $Date: 2004-11-09 11:50:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -125,6 +125,7 @@ VirtualMachine::~VirtualMachine() void VirtualMachine::acquireInitialContextClassLoader(JNIEnv * pEnv) { +#ifdef SOLAR_JAVA jclass aClass = pEnv->FindClass("java/lang/Thread"); jmethodID aMethod1 = pEnv->GetStaticMethodID(aClass, "currentThread", "()Ljava/lang/Thread;"); @@ -142,10 +143,12 @@ void VirtualMachine::acquireInitialContextClassLoader(JNIEnv * pEnv) OSL_ENSURE(m_aInitialContextClassLoader != 0, "JNI: NewGlobalRef failed"); } +#endif } void VirtualMachine::releaseInitialContextClassLoader() const { +#ifdef SOLAR_JAVA if (m_aInitialContextClassLoader != 0) { JNIEnv * pEnv; @@ -159,10 +162,14 @@ void VirtualMachine::releaseInitialContextClassLoader() const OSL_ENSURE(n == JNI_OK, "JNI: DetachCurrentThread failed"); } } +#endif } JNIEnv * VirtualMachine::attachThread(bool * pAttached) const { +#ifndef SOLAR_JAVA + return 0; +#else OSL_ENSURE(pAttached != 0, "bad parameter"); JNIEnv * pEnv; jint n = m_pVm->GetEnv(reinterpret_cast< void ** >(&pEnv), m_nVersion); @@ -190,10 +197,13 @@ JNIEnv * VirtualMachine::attachThread(bool * pAttached) const else *pAttached = false; return pEnv; +#endif } void VirtualMachine::detachThread() const { +#ifdef SOLAR_JAVA jint n = m_pVm->DetachCurrentThread(); OSL_ENSURE(n == JNI_OK, "JNI: DetachCurrentThread failed"); +#endif } |