add #undef for some stdlibc api.

Change-Id: I6253a9231af8809e8362f4bc5a1bd67fb094c3b0
This commit is contained in:
mage1
2021-04-14 15:43:16 +08:00
parent 09bdee7713
commit 2a08dc1685
29 changed files with 36 additions and 1 deletions
+8 -1
View File
@@ -55,10 +55,17 @@
* Removed from Open Group Base Specifications Issue 7/
* IEEE Std 1003.1-2008
*/
#ifndef bcmp
#define bcmp(b1,b2,len) memcmp(b1,b2,(size_t)len)
#endif
#ifndef bcopy
#define bcopy(b1,b2,len) (void)memmove(b2,b1,len)
#endif
#ifndef bzero
#define bzero(s,n) (void)memset(s,0,n)
#endif
/****************************************************************************
* Inline Functions
+1
View File
@@ -28,6 +28,7 @@
* Public Functions
****************************************************************************/
#undef atoi
int atoi(FAR const char *nptr)
{
return strtol(nptr, NULL, 10);
+1
View File
@@ -28,6 +28,7 @@
* Public Functions
****************************************************************************/
#undef atol
long atol(FAR const char *nptr)
{
return strtol(nptr, NULL, 10);
+1
View File
@@ -32,6 +32,7 @@
* Name: index
****************************************************************************/
#undef index
FAR char *index(FAR const char *s, int c)
{
return strchr(s, c);
+1
View File
@@ -62,6 +62,7 @@
*
****************************************************************************/
#undef memccpy
FAR void *memccpy(FAR void *s1, FAR const void *s2, int c, size_t n)
{
FAR unsigned char *pout = (FAR unsigned char *)s1;
+1
View File
@@ -59,6 +59,7 @@
*
****************************************************************************/
#undef memchr
FAR void *memchr(FAR const void *s, int c, size_t n)
{
FAR const unsigned char *p = (FAR const unsigned char *)s;
+1
View File
@@ -46,6 +46,7 @@
****************************************************************************/
#ifndef CONFIG_LIBC_ARCH_MEMCMP
#undef memcmp
int memcmp(FAR const void *s1, FAR const void *s2, size_t n)
{
unsigned char *p1 = (unsigned char *)s1;
+1
View File
@@ -50,6 +50,7 @@
****************************************************************************/
#ifndef CONFIG_LIBC_ARCH_MEMCPY
#undef memcpy
FAR void *memcpy(FAR void *dest, FAR const void *src, size_t n)
{
FAR unsigned char *pout = (FAR unsigned char *)dest;
+1
View File
@@ -46,6 +46,7 @@
****************************************************************************/
#ifndef CONFIG_LIBC_ARCH_MEMMOVE
#undef memmove
FAR void *memmove(FAR void *dest, FAR const void *src, size_t count)
{
FAR char *tmp;
+1
View File
@@ -63,6 +63,7 @@
****************************************************************************/
#ifndef CONFIG_LIBC_ARCH_MEMSET
#undef memset
FAR void *memset(FAR void *s, int c, size_t n)
{
#ifdef CONFIG_MEMSET_OPTSPEED
+1
View File
@@ -32,6 +32,7 @@
* Name: rindex
****************************************************************************/
#undef rindex
FAR char *rindex(FAR const char *s, int c)
{
return strrchr(s, c);
+1
View File
@@ -47,6 +47,7 @@
****************************************************************************/
#ifndef CONFIG_ARCH_STRCASECMP
#undef strcasecmp
int strcasecmp(FAR const char *cs, FAR const char *ct)
{
int result;
+1
View File
@@ -46,6 +46,7 @@
****************************************************************************/
#ifndef CONFIG_ARCH_STRCAT
#undef strcat
char *strcat(char *dest, const char *src)
{
char *ret = dest;
+1
View File
@@ -60,6 +60,7 @@
****************************************************************************/
#ifndef CONFIG_LIBC_ARCH_STRCHR
#undef strchr
FAR char *strchr(FAR const char *s, int c)
{
if (s)
+1
View File
@@ -46,6 +46,7 @@
****************************************************************************/
#ifndef CONFIG_LIBC_ARCH_STRCMP
#undef strcmp
int strcmp(FAR const char *cs, FAR const char *ct)
{
register signed char result;
+1
View File
@@ -58,6 +58,7 @@
****************************************************************************/
#ifndef CONFIG_LIBC_ARCH_STRCPY
#undef strcpy
FAR char *strcpy(FAR char *dest, FAR const char *src)
{
char *tmp = dest;
+1
View File
@@ -54,6 +54,7 @@
*
****************************************************************************/
#undef strcspn
size_t strcspn(const char *s, const char *reject)
{
size_t i;
+1
View File
@@ -47,6 +47,7 @@
* Public Functions
****************************************************************************/
#undef strdup
FAR char *strdup(FAR const char *s)
{
FAR char *news = NULL;
+1
View File
@@ -46,6 +46,7 @@
****************************************************************************/
#ifndef CONFIG_LIBC_ARCH_STRLEN
#undef strlen
size_t strlen(const char *s)
{
const char *sc;
+1
View File
@@ -48,6 +48,7 @@
****************************************************************************/
#ifndef CONFIG_ARCH_STRNCASECMP
#undef strncasecmp
int strncasecmp(const char *cs, const char *ct, size_t nb)
{
int result = 0;
+1
View File
@@ -46,6 +46,7 @@
****************************************************************************/
#ifndef CONFIG_ARCH_STRNCAT
#undef strncat
char *strncat(char *dest, const char *src, size_t n)
{
char *ret = dest;
+1
View File
@@ -46,6 +46,7 @@
****************************************************************************/
#ifndef CONFIG_ARCH_STRNCMP
#undef strncmp
int strncmp(const char *cs, const char *ct, size_t nb)
{
int result = 0;
+1
View File
@@ -67,6 +67,7 @@
****************************************************************************/
#ifndef CONFIG_LIBC_ARCH_STRNCPY
#undef strncpy
FAR char *strncpy(FAR char *dest, FAR const char *src, size_t n)
{
FAR char *ret = dest; /* Value to be returned */
+1
View File
@@ -63,6 +63,7 @@
*
****************************************************************************/
#undef strndup
FAR char *strndup(FAR const char *s, size_t size)
{
FAR char *news = NULL;
+1
View File
@@ -45,6 +45,7 @@
* Public Functions
****************************************************************************/
#undef strpbrk
FAR char *strpbrk(FAR const char *str, FAR const char *charset)
{
/* Sanity checking */
+1
View File
@@ -49,6 +49,7 @@
* occurrence of the character c in the string s.
*/
#undef strrchr
FAR char *strrchr(FAR const char *s, int c)
{
if (s)
+1
View File
@@ -54,6 +54,7 @@
*
****************************************************************************/
#undef strspn
size_t strspn(const char *s, const char *accept)
{
size_t i;
+1
View File
@@ -57,6 +57,7 @@
* string haystack. Returns NULL if needle was not found.
*/
#undef strstr
FAR char *strstr(FAR const char *haystack, FAR const char *needle)
{
#ifndef ULONG_BIGENDIAN
+1
View File
@@ -81,6 +81,7 @@ static char *g_saveptr = NULL;
*
****************************************************************************/
#undef strtok
char *strtok(char *str, const char *delim)
{
return strtok_r(str, delim, &g_saveptr);