From 202ab4c1e988c3d4cbe46aaece70862a6979fc38 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sat, 22 Jul 2023 18:15:58 +0100 Subject: [PATCH] GameActivity PATCH: Rename android_main _rust_glue_entry The real `android_main` is going to be written in Rust and android-activity needs to handle its own initialization before calling the application's `android_main` and so the C/C++ code calls an intermediate `_rust_glue_entry` function. --- .../game-activity/native_app_glue/android_native_app_glue.c | 2 +- .../game-activity/native_app_glue/android_native_app_glue.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c index 09a4b22..56e3a44 100644 --- a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c +++ b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c @@ -233,7 +233,7 @@ static void* android_app_entry(void* param) { pthread_cond_broadcast(&android_app->cond); pthread_mutex_unlock(&android_app->mutex); - android_main(android_app); + _rust_glue_entry(android_app); android_app_destroy(android_app); return NULL; diff --git a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.h b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.h index e63026f..f504ac4 100644 --- a/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.h +++ b/android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.h @@ -448,10 +448,10 @@ void android_app_clear_motion_events(struct android_input_buffer* inputBuffer); void android_app_clear_key_events(struct android_input_buffer* inputBuffer); /** - * This is the function that application code must implement, representing - * the main entry to the app. + * This is a springboard into the Rust glue layer that wraps calling the + * main entry for the app itself. */ -extern void android_main(struct android_app* app); +extern void _rust_glue_entry(struct android_app* app); /** * Set the filter to use when processing key events.