Index: src/amiga-library.h ================================================================== --- src/amiga-library.h +++ src/amiga-library.h @@ -72,15 +72,25 @@ int *_Nonnull (*_Nonnull errNo)(void); /* Needed only by ObjFW. */ int (*_Nonnull vsnprintf)(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); + float (*_Nonnull strtof)(const char *_Nonnull, + char *_Nullable *_Nullable); + double (*_Nonnull strtod)(const char *_Nonnull, + char *_Nullable *_Nullable); +#ifdef OF_MORPHOS + struct tm *(*_Nonnull gmtime_r)(const time_t *_Nonnull, + struct tm *_Nonnull); + struct tm *(*_Nonnull localtime_r)(const time_t *_Nonnull, + struct tm *_Nonnull); #endif + time_t (*_Nonnull mktime)(struct tm *_Nonnull); + int (*_Nonnull gettimeofday)(struct timeval *_Nonnull, + struct timezone *_Nullable); + size_t (*_Nonnull strftime)(char *_Nonnull, size_t, + const char *_Nonnull, const struct tm *_Nonnull); void (*_Nonnull exit)(int); int (*_Nonnull atexit)(void (*_Nonnull)(void)); OFSignalHandler _Nullable (*_Nonnull signal)(int, OFSignalHandler _Nullable); char *_Nullable (*_Nonnull setlocale)(int, const char *_Nullable); int (*_Nonnull _Unwind_Backtrace)(int (*_Nonnull)(void *_Nonnull, Index: src/amiga-library.m ================================================================== --- src/amiga-library.m +++ src/amiga-library.m @@ -561,24 +561,53 @@ va_list args) { return libC.vsnprintf(str, size, fmt, args); } -#ifdef OF_AMIGAOS_M68K +float +strtof(const char *str, char **endptr) +{ + return libC.strtof(str, endptr); +} + +double +strtod(const char *str, char **endptr) +{ + return libC.strtod(str, endptr); +} + +#ifdef OF_MORPHOS +struct tm * +gmtime_r(const time_t *time, struct tm *tm) +{ + return libC.gmtime_r(time, tm); +} + +struct tm * +localtime_r(const time_t *time, struct tm *tm) +{ + return libC.localtime_r(time, tm); +} +#endif + 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 +gettimeofday(struct timeval *tv, struct timezone *tz) +{ + return libC.gettimeofday(tv, tz); +} + +time_t +mktime(struct tm *tm) +{ + return libC.mktime(tm); +} + +size_t +strftime(char *str, size_t len, const char *fmt, const struct tm *tm) +{ + return libC.strftime(str, len, fmt, tm); +} void exit(int status) { libC.exit(status); Index: src/linklib/init.m ================================================================== --- src/linklib/init.m +++ src/linklib/init.m @@ -346,13 +346,19 @@ .__register_frame = __register_frame, .__deregister_frame = __deregister_frame, #endif .errNo = errNo, .vsnprintf = vsnprintf, -#ifdef OF_AMIGAOS_M68K - .vsscanf = vsscanf, + .strtof = strtof, + .strtod = strtod, +#ifdef OF_MORPHOS + .gmtime_r = gmtime_r, + .localtime_r = localtime_r, #endif + .mktime = mktime, + .gettimeofday = gettimeofday, + .strftime = strftime, .exit = exit, .atexit = atexit, .signal = signal, .setlocale = setlocale, ._Unwind_Backtrace = _Unwind_Backtrace