Skip to content

Commit

Permalink
Do not cast JavaEnv to void** for AttachCurrentThread on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueMatt committed Jun 12, 2021
1 parent d4e3e76 commit 4adc27e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion java_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,10 @@ def construct_jenv(self):
res = "JNIEnv *env;\n"
res += "jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);\n"
res += "if (get_jenv_res == JNI_EDETACHED) {\n"
res += "\tDO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);\n"
if self.target == Target.ANDROID:
res += "\tDO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, &env, NULL) == JNI_OK);\n"
else:
res += "\tDO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);\n"
res += "} else {\n"
res += "\tDO_ASSERT(get_jenv_res == JNI_OK);\n"
res += "}\n"
Expand Down

0 comments on commit 4adc27e

Please sign in to comment.