diff options
Diffstat (limited to 'jvmaccess')
-rw-r--r-- | jvmaccess/source/virtualmachine.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/jvmaccess/source/virtualmachine.cxx b/jvmaccess/source/virtualmachine.cxx index da7aa3843188..3e1208808866 100644 --- a/jvmaccess/source/virtualmachine.cxx +++ b/jvmaccess/source/virtualmachine.cxx @@ -105,7 +105,16 @@ JNIEnv * VirtualMachine::attachThread(bool * pAttached) const } if (pEnv == 0) { - if (m_pVm->AttachCurrentThread(reinterpret_cast< void ** >(&pEnv), 0) + if (m_pVm->AttachCurrentThread + ( +#ifndef ANDROID + reinterpret_cast< void ** >(&pEnv), +#else + // The Android <jni.h> has AttachCurrentThread() taking a + // JNIEnv** and not void ** + &pEnv, +#endif + 0) != JNI_OK) return 0; *pAttached = true; |