diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h index 35357d21..e90dacf2 100644 --- a/libc/include/stdlib.h +++ b/libc/include/stdlib.h @@ -98,8 +98,13 @@ extern "C" * endptr if nonnull. */ unsigned long strtoul(const char* str, char** endptr, int base); -#define strtoll strtol -#define strtoull strtoul + /* Parse an integer of the specified base from a string, storing the first non-number character in endptr if + * nonnull. */ + long long strtoll(const char* str, char** endptr, int base); + + /* Parse an unsigned integer of the specified base from a string, storing the first non-number character in + * endptr if nonnull. */ + unsigned long long strtoull(const char* str, char** endptr, int base); /* Return the next pseudorandom number. */ int rand(); diff --git a/libc/src/stdlib.cpp b/libc/src/stdlib.cpp index acbd7d9b..6d17aac8 100644 --- a/libc/src/stdlib.cpp +++ b/libc/src/stdlib.cpp @@ -101,6 +101,16 @@ extern "C" return rc; } + long long strtoll(const char* str, char** endptr, int base) + { + return strtol(str, endptr, base); + } + + unsigned long long strtoull(const char* str, char** endptr, int base) + { + return strtoul(str, endptr, base); + } + __noreturn void abort() { // First, try to unblock SIGABRT and then raise it.