Move retro_fail to retroarch.c
This commit is contained in:
parent
27905df040
commit
2d04a8063f
18
general.h
18
general.h
|
@ -74,22 +74,6 @@ enum sound_mode_enums
|
||||||
*
|
*
|
||||||
* Sanely kills the program.
|
* Sanely kills the program.
|
||||||
**/
|
**/
|
||||||
static INLINE void retro_fail(int error_code, const char *error)
|
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
23
retroarch.c
23
retroarch.c
|
@ -1691,3 +1691,26 @@ int rarch_info_get_capabilities(enum rarch_capabilities type, char *s, size_t le
|
||||||
|
|
||||||
return 0;
|
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);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue