diff --git a/include/strings.h b/include/strings.h index 17543569236..72ea016d748 100644 --- a/include/strings.h +++ b/include/strings.h @@ -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 diff --git a/libs/libc/stdlib/lib_atoi.c b/libs/libc/stdlib/lib_atoi.c index 916dec70e16..1a9496db2f5 100644 --- a/libs/libc/stdlib/lib_atoi.c +++ b/libs/libc/stdlib/lib_atoi.c @@ -28,6 +28,7 @@ * Public Functions ****************************************************************************/ +#undef atoi int atoi(FAR const char *nptr) { return strtol(nptr, NULL, 10); diff --git a/libs/libc/stdlib/lib_atol.c b/libs/libc/stdlib/lib_atol.c index e3f20643012..8d8b2ac04fc 100644 --- a/libs/libc/stdlib/lib_atol.c +++ b/libs/libc/stdlib/lib_atol.c @@ -28,6 +28,7 @@ * Public Functions ****************************************************************************/ +#undef atol long atol(FAR const char *nptr) { return strtol(nptr, NULL, 10); diff --git a/libs/libc/string/lib_index.c b/libs/libc/string/lib_index.c index 9056b5f18ae..b3c123d15b6 100644 --- a/libs/libc/string/lib_index.c +++ b/libs/libc/string/lib_index.c @@ -32,6 +32,7 @@ * Name: index ****************************************************************************/ +#undef index FAR char *index(FAR const char *s, int c) { return strchr(s, c); diff --git a/libs/libc/string/lib_memccpy.c b/libs/libc/string/lib_memccpy.c index 5f712771bce..e7b03ca8f0e 100644 --- a/libs/libc/string/lib_memccpy.c +++ b/libs/libc/string/lib_memccpy.c @@ -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; diff --git a/libs/libc/string/lib_memchr.c b/libs/libc/string/lib_memchr.c index 5b1facabad7..c9a951543a9 100644 --- a/libs/libc/string/lib_memchr.c +++ b/libs/libc/string/lib_memchr.c @@ -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; diff --git a/libs/libc/string/lib_memcmp.c b/libs/libc/string/lib_memcmp.c index c17149fbfdb..522f8b001fa 100644 --- a/libs/libc/string/lib_memcmp.c +++ b/libs/libc/string/lib_memcmp.c @@ -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; diff --git a/libs/libc/string/lib_memcpy.c b/libs/libc/string/lib_memcpy.c index 8fbeb0644bd..ca5ddf05b1a 100644 --- a/libs/libc/string/lib_memcpy.c +++ b/libs/libc/string/lib_memcpy.c @@ -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; diff --git a/libs/libc/string/lib_memmove.c b/libs/libc/string/lib_memmove.c index f8c4e890d30..96c6bdd1c7c 100644 --- a/libs/libc/string/lib_memmove.c +++ b/libs/libc/string/lib_memmove.c @@ -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; diff --git a/libs/libc/string/lib_memset.c b/libs/libc/string/lib_memset.c index da3d4ada80d..a29e3eefaaf 100644 --- a/libs/libc/string/lib_memset.c +++ b/libs/libc/string/lib_memset.c @@ -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 diff --git a/libs/libc/string/lib_rindex.c b/libs/libc/string/lib_rindex.c index 9be145e312f..10fceab0d32 100644 --- a/libs/libc/string/lib_rindex.c +++ b/libs/libc/string/lib_rindex.c @@ -32,6 +32,7 @@ * Name: rindex ****************************************************************************/ +#undef rindex FAR char *rindex(FAR const char *s, int c) { return strrchr(s, c); diff --git a/libs/libc/string/lib_strcasecmp.c b/libs/libc/string/lib_strcasecmp.c index a8b6ae8ea87..6361bf4e631 100644 --- a/libs/libc/string/lib_strcasecmp.c +++ b/libs/libc/string/lib_strcasecmp.c @@ -47,6 +47,7 @@ ****************************************************************************/ #ifndef CONFIG_ARCH_STRCASECMP +#undef strcasecmp int strcasecmp(FAR const char *cs, FAR const char *ct) { int result; diff --git a/libs/libc/string/lib_strcat.c b/libs/libc/string/lib_strcat.c index 18a70d8966e..e2058bdb024 100644 --- a/libs/libc/string/lib_strcat.c +++ b/libs/libc/string/lib_strcat.c @@ -46,6 +46,7 @@ ****************************************************************************/ #ifndef CONFIG_ARCH_STRCAT +#undef strcat char *strcat(char *dest, const char *src) { char *ret = dest; diff --git a/libs/libc/string/lib_strchr.c b/libs/libc/string/lib_strchr.c index c86e0468522..0d40e7ac8c7 100644 --- a/libs/libc/string/lib_strchr.c +++ b/libs/libc/string/lib_strchr.c @@ -60,6 +60,7 @@ ****************************************************************************/ #ifndef CONFIG_LIBC_ARCH_STRCHR +#undef strchr FAR char *strchr(FAR const char *s, int c) { if (s) diff --git a/libs/libc/string/lib_strcmp.c b/libs/libc/string/lib_strcmp.c index dab875ce709..c1129c7f040 100644 --- a/libs/libc/string/lib_strcmp.c +++ b/libs/libc/string/lib_strcmp.c @@ -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; diff --git a/libs/libc/string/lib_strcpy.c b/libs/libc/string/lib_strcpy.c index 864e417fada..0b9dc80ce87 100644 --- a/libs/libc/string/lib_strcpy.c +++ b/libs/libc/string/lib_strcpy.c @@ -58,6 +58,7 @@ ****************************************************************************/ #ifndef CONFIG_LIBC_ARCH_STRCPY +#undef strcpy FAR char *strcpy(FAR char *dest, FAR const char *src) { char *tmp = dest; diff --git a/libs/libc/string/lib_strcspn.c b/libs/libc/string/lib_strcspn.c index 431d8d4fee9..19e165486c0 100644 --- a/libs/libc/string/lib_strcspn.c +++ b/libs/libc/string/lib_strcspn.c @@ -54,6 +54,7 @@ * ****************************************************************************/ +#undef strcspn size_t strcspn(const char *s, const char *reject) { size_t i; diff --git a/libs/libc/string/lib_strdup.c b/libs/libc/string/lib_strdup.c index 1d88195ae9d..ea8b82fd162 100644 --- a/libs/libc/string/lib_strdup.c +++ b/libs/libc/string/lib_strdup.c @@ -47,6 +47,7 @@ * Public Functions ****************************************************************************/ +#undef strdup FAR char *strdup(FAR const char *s) { FAR char *news = NULL; diff --git a/libs/libc/string/lib_strlen.c b/libs/libc/string/lib_strlen.c index 6e29a434b04..f7758c9a802 100644 --- a/libs/libc/string/lib_strlen.c +++ b/libs/libc/string/lib_strlen.c @@ -46,6 +46,7 @@ ****************************************************************************/ #ifndef CONFIG_LIBC_ARCH_STRLEN +#undef strlen size_t strlen(const char *s) { const char *sc; diff --git a/libs/libc/string/lib_strncasecmp.c b/libs/libc/string/lib_strncasecmp.c index 82a15b2491c..88a6391f44a 100644 --- a/libs/libc/string/lib_strncasecmp.c +++ b/libs/libc/string/lib_strncasecmp.c @@ -48,6 +48,7 @@ ****************************************************************************/ #ifndef CONFIG_ARCH_STRNCASECMP +#undef strncasecmp int strncasecmp(const char *cs, const char *ct, size_t nb) { int result = 0; diff --git a/libs/libc/string/lib_strncat.c b/libs/libc/string/lib_strncat.c index 152ca32da0b..b27f3ebbff7 100644 --- a/libs/libc/string/lib_strncat.c +++ b/libs/libc/string/lib_strncat.c @@ -46,6 +46,7 @@ ****************************************************************************/ #ifndef CONFIG_ARCH_STRNCAT +#undef strncat char *strncat(char *dest, const char *src, size_t n) { char *ret = dest; diff --git a/libs/libc/string/lib_strncmp.c b/libs/libc/string/lib_strncmp.c index 0aadda5c4b1..c08170893ae 100644 --- a/libs/libc/string/lib_strncmp.c +++ b/libs/libc/string/lib_strncmp.c @@ -46,6 +46,7 @@ ****************************************************************************/ #ifndef CONFIG_ARCH_STRNCMP +#undef strncmp int strncmp(const char *cs, const char *ct, size_t nb) { int result = 0; diff --git a/libs/libc/string/lib_strncpy.c b/libs/libc/string/lib_strncpy.c index b0263524eb8..3f9145b3423 100644 --- a/libs/libc/string/lib_strncpy.c +++ b/libs/libc/string/lib_strncpy.c @@ -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 */ diff --git a/libs/libc/string/lib_strndup.c b/libs/libc/string/lib_strndup.c index a071d188627..ae54f918f23 100644 --- a/libs/libc/string/lib_strndup.c +++ b/libs/libc/string/lib_strndup.c @@ -63,6 +63,7 @@ * ****************************************************************************/ +#undef strndup FAR char *strndup(FAR const char *s, size_t size) { FAR char *news = NULL; diff --git a/libs/libc/string/lib_strpbrk.c b/libs/libc/string/lib_strpbrk.c index 6e7ab63d0c2..f74a241981a 100644 --- a/libs/libc/string/lib_strpbrk.c +++ b/libs/libc/string/lib_strpbrk.c @@ -45,6 +45,7 @@ * Public Functions ****************************************************************************/ +#undef strpbrk FAR char *strpbrk(FAR const char *str, FAR const char *charset) { /* Sanity checking */ diff --git a/libs/libc/string/lib_strrchr.c b/libs/libc/string/lib_strrchr.c index 8e96d81c9d0..da22bd0849e 100644 --- a/libs/libc/string/lib_strrchr.c +++ b/libs/libc/string/lib_strrchr.c @@ -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) diff --git a/libs/libc/string/lib_strspn.c b/libs/libc/string/lib_strspn.c index 3804bdfc281..ce10c197a15 100644 --- a/libs/libc/string/lib_strspn.c +++ b/libs/libc/string/lib_strspn.c @@ -54,6 +54,7 @@ * ****************************************************************************/ +#undef strspn size_t strspn(const char *s, const char *accept) { size_t i; diff --git a/libs/libc/string/lib_strstr.c b/libs/libc/string/lib_strstr.c index 5253ed02aca..18c7605b067 100644 --- a/libs/libc/string/lib_strstr.c +++ b/libs/libc/string/lib_strstr.c @@ -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 diff --git a/libs/libc/string/lib_strtok.c b/libs/libc/string/lib_strtok.c index 8c39a635130..3a747183a0e 100644 --- a/libs/libc/string/lib_strtok.c +++ b/libs/libc/string/lib_strtok.c @@ -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);