mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 00:32:49 +00:00
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.
|
||||
**/
|
||||
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
|
||||
|
||||
|
||||
|
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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…
x
Reference in New Issue
Block a user