lbry-android/p4a/pythonforandroid/recipes/sdl2/add_nativeSetEnv.patch
Akinwale Ariwodola 744cfaebc2 Initial commit
2017-08-13 02:24:00 +01:00

22 lines
910 B
Diff

--- orig/src/core/android/SDL_android.c 2016-01-02 20:56:31.000000000 +0100
+++ patch/src/core/android/SDL_android.c 2016-04-15 22:21:13.985708267 +0200
@@ -188,6 +188,19 @@
Android_OnHat(device_id, hat_id, x, y);
}
+/* Patched in env var setter for python-for-android */
+JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_nativeSetEnv(
+ JNIEnv* env, jclass jcls,
+ jstring j_name, jstring j_value)
+{
+ jboolean iscopy;
+ const char *name = (*env)->GetStringUTFChars(env, j_name, &iscopy);
+ const char *value = (*env)->GetStringUTFChars(env, j_value, &iscopy);
+ setenv(name, value, 1);
+ (*env)->ReleaseStringUTFChars(env, j_name, name);
+ (*env)->ReleaseStringUTFChars(env, j_value, value);
+}
+
JNIEXPORT jint JNICALL Java_org_libsdl_app_SDLActivity_nativeAddJoystick(
JNIEnv* env, jclass jcls,