diff --git a/userspace/libraries/LibC/CMakeLists.txt b/userspace/libraries/LibC/CMakeLists.txt index 113d0c0a1c..1ad81877cb 100644 --- a/userspace/libraries/LibC/CMakeLists.txt +++ b/userspace/libraries/LibC/CMakeLists.txt @@ -5,6 +5,7 @@ set(LIBC_SOURCES dirent.cpp fcntl.cpp grp.cpp + inttypes.cpp locale.cpp malloc.cpp math.cpp diff --git a/userspace/libraries/LibC/inttypes.cpp b/userspace/libraries/LibC/inttypes.cpp new file mode 100644 index 0000000000..3da954be57 --- /dev/null +++ b/userspace/libraries/LibC/inttypes.cpp @@ -0,0 +1,14 @@ +#include +#include + +intmax_t strtoimax(const char* __restrict nptr, char** __restrict endptr, int base) +{ + static_assert(sizeof(intmax_t) == sizeof(long long)); + return strtoll(nptr, endptr, base); +} + +uintmax_t strtoumax(const char* __restrict nptr, char** __restrict endptr, int base) +{ + static_assert(sizeof(uintmax_t) == sizeof(unsigned long long)); + return strtoull(nptr, endptr, base); +}