diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2023-02-02 17:29:19 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2023-02-03 13:27:06 -0400 |
commit | f2eabdb6257c09cf2890dac5e9737912728542af (patch) | |
tree | 3b46f6787185d65605651a0f48776dc9779ce648 /src/MSL_C.PPCEABI.bare.H/abort_exit.c | |
parent | eef1dd840b7cecac28c2e6b0574707b90a37d4e7 (diff) |
global: Add rest of Dolphin SDK proper, add MSL, and MetroTRK
Finally, it links properly.
Diffstat (limited to 'src/MSL_C.PPCEABI.bare.H/abort_exit.c')
-rw-r--r-- | src/MSL_C.PPCEABI.bare.H/abort_exit.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/MSL_C.PPCEABI.bare.H/abort_exit.c b/src/MSL_C.PPCEABI.bare.H/abort_exit.c new file mode 100644 index 0000000..b0ebade --- /dev/null +++ b/src/MSL_C.PPCEABI.bare.H/abort_exit.c @@ -0,0 +1,38 @@ +#include <stdlib.h> + +void __destroy_global_chain(void); +void _ExitProcess(void); + +extern void (*_dtors[])(void); + +static void (*__console_exit)(void); +void (*__stdio_exit)(void); +static int __atexit_curr_func; +int __aborting; + +static void (*__atexit_funcs[64])(void); + +void exit(int status) { + int i; + void (**dtor)(void); + + if (!__aborting) { + __destroy_global_chain(); + dtor = _dtors; + while (*dtor != NULL) { + (*dtor)(); + dtor++; + } + if (__stdio_exit != NULL) { + __stdio_exit(); + __stdio_exit = NULL; + } + } + while (__atexit_curr_func > 0) + __atexit_funcs[--__atexit_curr_func](); + if (__console_exit != NULL) { + __console_exit(); + __console_exit = NULL; + } + _ExitProcess(); +} |