Browse Source

Updated android_native_app_glue

Ray San 8 years ago
parent
commit
1288d6a5df

+ 0 - 10
src/external/android/native_app_glue/Android.mk

@@ -1,10 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE:= android_native_app_glue
-LOCAL_SRC_FILES:= android_native_app_glue.c
-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
-LOCAL_EXPORT_LDLIBS := -llog
-
-include $(BUILD_STATIC_LIBRARY)

+ 3 - 2
src/external/android/native_app_glue/android_native_app_glue.c

@@ -420,8 +420,9 @@ static void onInputQueueDestroyed(ANativeActivity* activity, AInputQueue* queue)
     android_app_set_input((struct android_app*)activity->instance, NULL);
 }
 
-void ANativeActivity_onCreate(ANativeActivity* activity,
-        void* savedState, size_t savedStateSize) {
+JNIEXPORT
+void ANativeActivity_onCreate(ANativeActivity* activity, void* savedState,
+                              size_t savedStateSize) {
     LOGV("Creating: %p\n", activity);
     activity->callbacks->onDestroy = onDestroy;
     activity->callbacks->onStart = onStart;

+ 7 - 2
src/external/android/native_app_glue/android_native_app_glue.h

@@ -332,9 +332,14 @@ void android_app_pre_exec_cmd(struct android_app* android_app, int8_t cmd);
 void android_app_post_exec_cmd(struct android_app* android_app, int8_t cmd);
 
 /**
- * Dummy function you can call to ensure glue code isn't stripped.
+ * Dummy function that used to be used to prevent the linker from stripping app
+ * glue code. No longer necessary, since __attribute__((visibility("default")))
+ * does this for us.
  */
-void app_dummy();
+__attribute__((
+    deprecated("Calls to app_dummy are no longer necessary. See "
+               "https://github.com/android-ndk/ndk/issues/381."))) void
+app_dummy();
 
 /**
  * This is the function that application code must implement, representing