diff --git a/include/hermit/stdlib.h b/include/hermit/stdlib.h index 9468133bd..e79ede32a 100644 --- a/include/hermit/stdlib.h +++ b/include/hermit/stdlib.h @@ -121,13 +121,17 @@ void page_free(void* addr, size_t sz); * * @return Long value of the parsed numerical string */ -long strtol(const char* str, char** endptr, int base); +long __strtol(const char* str, char** endptr, int base); + +#define strtol(str, endptr, base) __strtol((str), (endptr), (base)) /** @brief String to unsigned long * * @return Unsigned long value of the parsed numerical string */ -unsigned long strtoul(const char* nptr, char** endptr, int base); +unsigned long __strtoul(const char* nptr, char** endptr, int base); + +#define strtoul(nptr, endptr, base) __strtoul((nptr), (endptr), (base)) /** @brief ASCII to integer * diff --git a/libkern/strtol.c b/libkern/strtol.c index bf31f3162..94f098c05 100644 --- a/libkern/strtol.c +++ b/libkern/strtol.c @@ -32,9 +32,9 @@ * From: @(#)strtol.c 8.1 (Berkeley) 6/4/93 */ -/* +/* * The code has been taken from FreeBSD (sys/libkern/strtol.c) and is consequently - * BSD-licensed. Unnecessary functions have been removed and all typedefs required + * BSD-licensed. Unnecessary functions have been removed and all typedefs required * have been added. */ @@ -50,7 +50,7 @@ * alphabets and digits are each contiguous. */ long -strtol(nptr, endptr, base) +__strtol(nptr, endptr, base) const char *nptr; char **endptr; int base; @@ -130,4 +130,3 @@ strtol(nptr, endptr, base) *((const char **)endptr) = any ? s - 1 : nptr; return (acc); } - diff --git a/libkern/strtoul.c b/libkern/strtoul.c index e0752f803..a2029a335 100644 --- a/libkern/strtoul.c +++ b/libkern/strtoul.c @@ -32,9 +32,9 @@ * From: @(#)strtoul.c 8.1 (Berkeley) 6/4/93 */ -/* +/* * The code has been taken from FreeBSD (sys/libkern/strtoul.c) and is consequently - * BSD-licensed. Unnecessary functions have been removed and all typedefs required + * BSD-licensed. Unnecessary functions have been removed and all typedefs required * have been added. */ @@ -50,7 +50,7 @@ * alphabets and digits are each contiguous. */ unsigned long -strtoul(nptr, endptr, base) +__strtoul(nptr, endptr, base) const char *nptr; char **endptr; int base; @@ -109,4 +109,3 @@ strtoul(nptr, endptr, base) *((const char **)endptr) = any ? s - 1 : nptr; return (acc); } -