Move retro_fail to retroarch.c

This commit is contained in:
twinaphex 2015-11-29 02:27:48 +01:00
parent 27905df040
commit 2d04a8063f
2 changed files with 24 additions and 17 deletions

View File

@ -74,22 +74,6 @@ enum sound_mode_enums
*
* Sanely kills the program.
**/
static INLINE void retro_fail(int error_code, const char *error)
{
global_t *global = global_get_ptr();
if (!global)
return;
/* We cannot longjmp unless we're in rarch_main_init().
* If not, something went very wrong, and we should
* just exit right away. */
retro_assert(global->inited.error);
strlcpy(global->error_string, error, sizeof(global->error_string));
longjmp(global->error_sjlj_context, error_code);
}
void retro_fail(int error_code, const char *error);
#endif

View File

@ -1691,3 +1691,26 @@ int rarch_info_get_capabilities(enum rarch_capabilities type, char *s, size_t le
return 0;
}
/**
* retro_fail:
* @error_code : Error code.
* @error : Error message to show.
*
* Sanely kills the program.
**/
void retro_fail(int error_code, const char *error)
{
global_t *global = global_get_ptr();
if (!global)
return;
/* We cannot longjmp unless we're in rarch_main_init().
* If not, something went very wrong, and we should
* just exit right away. */
retro_assert(global->inited.error);
strlcpy(global->error_string, error, sizeof(global->error_string));
longjmp(global->error_sjlj_context, error_code);
}