17 lines
399 B
C
17 lines
399 B
C
#include <inttypes.h>
|
|
#include <stdlib.h>
|
|
|
|
#if __INTMAX_WIDTH__ == __LONG_WIDTH__
|
|
# define __strtoumax strtoul
|
|
#elif __INTMAX_WIDTH__ == __LONG_LONG_WIDTH__
|
|
# define __strtoumax strtoull
|
|
#else
|
|
# error How is uintmax_t neither unsigned long nor unsigned long long?
|
|
#endif
|
|
|
|
uintmax_t strtoumax(char const * restrict ptr, char ** restrict endptr,
|
|
int base)
|
|
{
|
|
return __strtoumax(ptr, endptr, base);
|
|
}
|