diff options
| author | spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> | 2022-02-20 12:31:31 +0100 |
|---|---|---|
| committer | spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> | 2022-02-20 12:31:31 +0100 |
| commit | 72db767f5a5bdb958bb11bcb6fe6b9b332a2b195 (patch) | |
| tree | af217b41f42f78180b821e682c54f60ab0f3dd78 /libpsn00b/libc | |
| parent | aca79b2a75c9a6106bc0047f767a475a2c3aaf8e (diff) | |
| download | psn00bsdk-72db767f5a5bdb958bb11bcb6fe6b9b332a2b195.tar.gz | |
Rewrite assert() and DL_CALL(), update mkpsxiso
Diffstat (limited to 'libpsn00b/libc')
| -rw-r--r-- | libpsn00b/libc/abort.c | 14 | ||||
| -rw-r--r-- | libpsn00b/libc/c++-support.cxx | 22 |
2 files changed, 21 insertions, 15 deletions
diff --git a/libpsn00b/libc/abort.c b/libpsn00b/libc/abort.c index ca5ab1d..1d07037 100644 --- a/libpsn00b/libc/abort.c +++ b/libpsn00b/libc/abort.c @@ -1,9 +1,15 @@ #include <stdio.h> void abort() { - printf("abort()\n"); - - while(1); -}
\ No newline at end of file + for (;;) + __asm__ volatile(""); +} + +void _assert_abort(const char *file, int line, const char *expr) { + printf("%s:%d: assert(%s)\n", file, line, expr); + + for (;;) + __asm__ volatile(""); +} diff --git a/libpsn00b/libc/c++-support.cxx b/libpsn00b/libc/c++-support.cxx index d169fdb..d0c0f3a 100644 --- a/libpsn00b/libc/c++-support.cxx +++ b/libpsn00b/libc/c++-support.cxx @@ -1,28 +1,28 @@ -#include <assert.h> #include <stdint.h> #include <stdlib.h> +#include <stdio.h> -extern "C" +extern "C" void __cxa_pure_virtual(void) { + printf("__cxa_pure_virtual()\n"); -void __cxa_pure_virtual(void) { - /* Pure C++ virtual call; abort! */ - assert(false); + for (;;) + __asm__ volatile(""); } void* operator new(size_t size) { - return malloc(size); + return malloc(size); } void* operator new[](size_t size) { - return malloc(size); + return malloc(size); } void operator delete(void* ptr) { - free(ptr); + free(ptr); } void operator delete[](void* ptr) { - free(ptr); + free(ptr); } /*- @@ -35,5 +35,5 @@ void operator delete[](void* ptr) { * * A memory allocator can use the given size to be more efficient */ void operator delete(void* ptr, unsigned int) { - free(ptr); -}
\ No newline at end of file + free(ptr); +} |
