Merge pull request #544 from abnormalhare/main
Match MSL_C/abort_exit.c and MSL_C/mem.c
This commit is contained in:
commit
8d1da93f84
4 changed files with 42 additions and 4 deletions
10
.vscode/settings.json
vendored
10
.vscode/settings.json
vendored
|
|
@ -47,7 +47,15 @@
|
|||
"hsfformat.h": "c",
|
||||
"hsfanim.h": "c",
|
||||
"memory.h": "c",
|
||||
"animdata.h": "c"
|
||||
"animdata.h": "c",
|
||||
"abort_exit.h": "c",
|
||||
"critical_regions.h": "c",
|
||||
"stddef.h": "c",
|
||||
"nmwexception.h": "c",
|
||||
"signal.h": "c",
|
||||
"gx.h": "c",
|
||||
"dol2asm.h": "c",
|
||||
"__mem.h": "c"
|
||||
},
|
||||
"search.useIgnoreFiles": false,
|
||||
"search.exclude": {
|
||||
|
|
|
|||
|
|
@ -680,7 +680,7 @@ config.libs = [
|
|||
"cflags": cflags_msl,
|
||||
"host": False,
|
||||
"objects": [
|
||||
Object(NonMatching, "MSL_C.PPCEABI.bare.H/abort_exit.c"),
|
||||
Object(MatchingFor("GMPE01_00", "GMPE01_01"), "MSL_C.PPCEABI.bare.H/abort_exit.c"),
|
||||
Object(NonMatching, "MSL_C.PPCEABI.bare.H/alloc.c"),
|
||||
Object(MatchingFor("GMPE01_00", "GMPE01_01"), "MSL_C.PPCEABI.bare.H/errno.c"),
|
||||
Object(NonMatching, "MSL_C.PPCEABI.bare.H/ansi_files.c"),
|
||||
|
|
@ -692,7 +692,7 @@ config.libs = [
|
|||
Object(NonMatching, "MSL_C.PPCEABI.bare.H/file_io.c"),
|
||||
Object(NonMatching, "MSL_C.PPCEABI.bare.H/FILE_POS.c"),
|
||||
Object(NonMatching, "MSL_C.PPCEABI.bare.H/mbstring.c"),
|
||||
Object(NonMatching, "MSL_C.PPCEABI.bare.H/mem.c"),
|
||||
Object(MatchingFor("GMPE01_00", "GMPE01_01"), "MSL_C.PPCEABI.bare.H/mem.c"),
|
||||
Object(NonMatching, "MSL_C.PPCEABI.bare.H/mem_funcs.c"),
|
||||
Object(NonMatching, "MSL_C.PPCEABI.bare.H/misc_io.c"),
|
||||
Object(NonMatching, "MSL_C.PPCEABI.bare.H/printf.c"),
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include "PowerPC_EABI_Support/Msl/MSL_C/MSL_Common/abort_exit.h"
|
||||
#include "PowerPC_EABI_Support/Msl/MSL_C/MSL_Common/critical_regions.h"
|
||||
#include "PowerPC_EABI_Support/Msl/MSL_C/MSL_Common/signal.h"
|
||||
#include "stddef.h"
|
||||
#include "PowerPC_EABI_Support/Runtime/NMWException.h"
|
||||
|
||||
|
|
@ -20,7 +21,19 @@ void (*__console_exit)(void) = 0;
|
|||
|
||||
void abort(void)
|
||||
{
|
||||
// TODO
|
||||
void (**var_r31)(void);
|
||||
|
||||
raise(1);
|
||||
__aborting = 1;
|
||||
var_r31 = &__atexit_funcs[0];
|
||||
while (__atexit_curr_func > 0) {
|
||||
var_r31[--__atexit_curr_func]();
|
||||
}
|
||||
if (__console_exit != 0) {
|
||||
__console_exit();
|
||||
__console_exit = 0;
|
||||
}
|
||||
_ExitProcess();
|
||||
}
|
||||
|
||||
void exit(int status)
|
||||
|
|
|
|||
|
|
@ -60,6 +60,23 @@ void* memchr(const void* ptr, int ch, size_t count)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
unsigned char* __memrchr(unsigned char* s, int c, size_t n){ // credit to CelestialAmber
|
||||
int n_count;
|
||||
size_t char_check;
|
||||
|
||||
char_check = (unsigned char)c;
|
||||
s = &s[n];
|
||||
n_count = n + 1;
|
||||
|
||||
while(--n_count){
|
||||
if(*--s == char_check){
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int memcmp(const void* lhs, const void* rhs, size_t count)
|
||||
{
|
||||
const unsigned char* p1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue