mirror of
https://github.com/libretro/RetroArch
synced 2025-02-09 09:39:56 +00:00
(Frontend) Customize returntype, function signature of main
entry function depending on platform port
This commit is contained in:
parent
83c89e4c92
commit
0e553fd871
@ -98,13 +98,24 @@ static void rarch_get_environment_console(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(IOS) || defined(OSX) || defined(HAVE_BB10)
|
||||
#if defined(ANDROID)
|
||||
#define main_entry android_app_entry
|
||||
#define returntype void*
|
||||
#define signature() void* data
|
||||
#define returnfunc() exit(0)
|
||||
#elif defined(IOS) || defined(OSX) || defined(HAVE_BB10)
|
||||
#define main_entry rarch_main
|
||||
#define returntype int
|
||||
#define signature() int argc, char *argv[]
|
||||
#define returnfunc() return 0
|
||||
#else
|
||||
#define main_entry main
|
||||
#define returntype int
|
||||
#define signature() int argc, char *argv[]
|
||||
#define returnfunc() return 0
|
||||
#endif
|
||||
|
||||
int main_entry(int argc, char *argv[])
|
||||
returntype main_entry(signature())
|
||||
{
|
||||
void* args = NULL;
|
||||
frontend_ctx = (frontend_ctx_driver_t*)frontend_ctx_init_first();
|
||||
@ -284,5 +295,5 @@ int main_entry(int argc, char *argv[])
|
||||
if (frontend_ctx && frontend_ctx->shutdown)
|
||||
frontend_ctx->shutdown(false);
|
||||
|
||||
return 0;
|
||||
returnfunc();
|
||||
}
|
||||
|
@ -294,7 +294,7 @@ exit:
|
||||
|
||||
// exit() here is nasty.
|
||||
// pthread_exit(NULL) or return NULL; causes hanging ...
|
||||
// Should probably called ANativeActivity_finsih(), but it's bugged, it will hang our app.
|
||||
// Should probably call ANativeActivity_finish(), but it's bugged, it will hang our app.
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user