From: Matt Corallo Date: Sat, 12 Jun 2021 16:50:21 +0000 (+0000) Subject: Do not cast JavaEnv to void** for AttachCurrentThread on Android X-Git-Tag: v0.0.98.1~1 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=4adc27e9bf581b4f5edd148e12d7c344381d0f46;p=ldk-java Do not cast JavaEnv to void** for AttachCurrentThread on Android --- diff --git a/java_strings.py b/java_strings.py index e00f513f..3d5a2a01 100644 --- a/java_strings.py +++ b/java_strings.py @@ -457,7 +457,10 @@ import java.util.Arrays; 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"