coreinit: Use rplwrap for exit (__rplwrap_exit)

This commit is contained in:
Ash Logan 2019-04-22 12:43:37 +10:00
parent 4278819a01
commit f92657e8b5
5 changed files with 10 additions and 6 deletions

View File

@ -1210,7 +1210,6 @@ bspQuery
bspRead
bspShutdown
bspWrite
exit
//memclr
//memcpy
//memmove
@ -1229,6 +1228,9 @@ smdSimpleBufFree
smdSimpleBufGetStatistics
smdSimpleBufPoolCreate
:TEXT_WRAP
exit
:DATA
MEMAllocFromDefaultHeap
MEMAllocFromDefaultHeapEx

View File

@ -12,7 +12,7 @@ extern "C" {
#endif
void
exit(int code);
RPLWRAP(exit)(int code);
void
_Exit(int code);

View File

@ -8,3 +8,4 @@
#include "wut_structsize.h"
#include "wut_types.h"
#include "wut_rplwrap.h"

3
include/wut_rplwrap.h Normal file
View File

@ -0,0 +1,3 @@
#pragma once
#define RPLWRAP(func) __rplwrap_##func

View File

@ -1,9 +1,6 @@
#include "wut_newlib.h"
#include <coreinit/exit.h>
// Forward newlib _exit to the coreinit.rpl _Exit
extern void _Exit(int status);
static void
__init_wut_syscall_array()
{
@ -14,7 +11,8 @@ __init_wut_syscall_array()
__syscalls.lock_release = __wut_lock_release;
//__syscalls.malloc_lock = __wut_malloc_lock;
//__syscalls.malloc_unlock = __wut_malloc_unlock;
__syscalls.exit = _Exit;
//use coreinit's exit function
__syscalls.exit = RPLWRAP(exit);
__syscalls.gettod_r = __wut_gettod_r;
__syscalls.clock_gettime = __wut_clock_gettime;
__syscalls.clock_settime = __wut_clock_settime;