1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

rename functions to avoid collisions with newlib

This commit is contained in:
Stefan Lankes 2017-03-08 22:16:38 +01:00
parent 21f58abba1
commit 589867d293
3 changed files with 12 additions and 10 deletions

View file

@ -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
*

View file

@ -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);
}

View file

@ -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);
}