Index: src/amiga-library.h ================================================================== --- src/amiga-library.h +++ src/amiga-library.h @@ -25,10 +25,11 @@ # define OF_M68K_ARG(type, name, reg) \ register type reg_##name __asm__(#reg); \ type name = reg_##name; # endif +typedef void (*of_sig_t)(int); struct of_libc { /* * Needed by the runtime. Some of them are also used by ObjFW, but we * need all of them to pass them along to the runtime. */ @@ -68,13 +69,19 @@ # endif /* Needed only by ObjFW. */ int (*_Nonnull vsnprintf)(const char *_Nonnull restrict, size_t, const char *_Nonnull restrict, va_list); +# ifdef OF_AMIGAOS_M68K + /* strtod() uses sscanf() internally */ + int (*_Nonnull vsscanf)(const char *_Nonnull restrict, + const char *_Nonnull restrict, va_list); +# endif void (*_Nonnull exit)(int); char *_Nullable (*_Nonnull setlocale)(int, const char *_Nullable); int (*_Nonnull _Unwind_Backtrace)(int (*_Nonnull)(void *_Nonnull, void *_Null_unspecified), void *_Null_unspecified); + of_sig_t _Nullable (*_Nonnull signal)(int, of_sig_t _Nullable); }; extern bool of_init(unsigned int version, struct of_libc *libc, FILE **sF); #endif Index: src/amiga-library.m ================================================================== --- src/amiga-library.m +++ src/amiga-library.m @@ -524,10 +524,25 @@ va_list args) { return libc.vsnprintf(str, size, fmt, args); } +#ifdef OF_AMIGAOS_M68K +int +sscanf(const char *restrict str, const char *restrict fmt, ...) +{ + int ret; + va_list args; + + va_start(args, fmt); + ret = libc.vsscanf(str, fmt, args); + va_end(args); + + return ret; +} +#endif + void exit(int status) { libc.exit(status); @@ -543,10 +558,16 @@ int _Unwind_Backtrace(int (*callback)(void *, void *), void *data) { return libc._Unwind_Backtrace(callback, data); } + +of_sig_t +signal(int sig, of_sig_t func) +{ + return libc.signal(sig, func); +} #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" static CONST_APTR functionTable[] = { #ifdef OF_MORPHOS