@@ -46,10 +46,17 @@ int _start() { return -1; } + +#ifdef OF_AMIGAOS_M68K +void +__init_eh(void) +{ +} +#endif struct ObjFWRTBase { struct Library library; void *segList; struct ObjFWRTBase *parent; @@ -486,37 +493,10 @@ free(void *ptr) { libc.free(ptr); } -int -fprintf(FILE *restrict stream, const char *restrict fmt, ...) -{ - int ret; - va_list args; - - va_start(args, fmt); - ret = libc.vfprintf(stream, fmt, args); - va_end(args); - - return ret; -} - -int -fflush(FILE *restrict stream) -{ - return libc.fflush(stream); -} - -void -abort(void) -{ - libc.abort(); - - OF_UNREACHABLE -} - #ifdef HAVE_SJLJ_EXCEPTIONS int _Unwind_SjLj_RaiseException(void *ex) { return libc._Unwind_SjLj_RaiseException(ex); @@ -600,10 +580,46 @@ int * objc_get_errno(void) { return libc.get_errno(); } + +#ifdef OF_AMIGAOS_M68K +int +snprintf(char *restrict str, size_t size, const char *restrict fmt, ...) +{ + va_list args; + int ret; + + va_start(args, fmt); + ret = vsnprintf(str, size, fmt, args); + va_end(args); + + return ret; +} + +int +vsnprintf(char *restrict str, size_t size, const char *restrict fmt, + va_list args) +{ + return libc.vsnprintf(str, size, fmt, args); +} +#endif + +int +atexit(void (*function)(void)) +{ + return libc.atexit(function); +} + +void +exit(int status) +{ + libc.exit(status); + + OF_UNREACHABLE +} #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" static CONST_APTR functionTable[] = { #ifdef OF_MORPHOS