Skip to content

Commit 7e374a5

Browse files
ribjb55
authored andcommitted
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.
1 parent 1fa4b6a commit 7e374a5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ static void* android_app_entry(void* param) {
234234
pthread_cond_broadcast(&android_app->cond);
235235
pthread_mutex_unlock(&android_app->mutex);
236236

237-
android_main(android_app);
237+
_rust_glue_entry(android_app);
238238

239239
android_app_destroy(android_app);
240240
return NULL;

android-activity/game-activity-csrc/game-activity/native_app_glue/android_native_app_glue.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,10 +481,10 @@ void android_app_clear_motion_events(struct android_input_buffer* inputBuffer);
481481
void android_app_clear_key_events(struct android_input_buffer* inputBuffer);
482482

483483
/**
484-
* This is the function that application code must implement, representing
485-
* the main entry to the app.
484+
* This is a springboard into the Rust glue layer that wraps calling the
485+
* main entry for the app itself.
486486
*/
487-
extern void android_main(struct android_app* app);
487+
extern void _rust_glue_entry(struct android_app* app);
488488

489489
/**
490490
* Set the filter to use when processing key events.

0 commit comments

Comments
 (0)