summaryrefslogtreecommitdiff
path: root/libc/string/generic
diff options
context:
space:
mode:
Diffstat (limited to 'libc/string/generic')
-rw-r--r--libc/string/generic/memchr.c4
-rw-r--r--libc/string/generic/memcmp.c6
-rw-r--r--libc/string/generic/memcpy.c4
-rw-r--r--libc/string/generic/memmem.c4
-rw-r--r--libc/string/generic/memmove.c4
-rw-r--r--libc/string/generic/mempcpy.c2
-rw-r--r--libc/string/generic/memrchr.c4
-rw-r--r--libc/string/generic/memset.c4
-rw-r--r--libc/string/generic/rawmemchr.c4
-rw-r--r--libc/string/generic/strcat.c4
-rw-r--r--libc/string/generic/strchr.c6
-rw-r--r--libc/string/generic/strchrnul.c4
-rw-r--r--libc/string/generic/strcmp.c13
-rw-r--r--libc/string/generic/strcpy.c4
-rw-r--r--libc/string/generic/strcspn.c4
-rw-r--r--libc/string/generic/strlen.c4
-rw-r--r--libc/string/generic/strncat.c4
-rw-r--r--libc/string/generic/strncmp.c4
-rw-r--r--libc/string/generic/strncpy.c4
-rw-r--r--libc/string/generic/strnlen.c4
-rw-r--r--libc/string/generic/strrchr.c6
-rw-r--r--libc/string/generic/strsep.c4
-rw-r--r--libc/string/generic/strspn.c4
-rw-r--r--libc/string/generic/strstr.c4
-rw-r--r--libc/string/generic/strtok_r.c14
25 files changed, 34 insertions, 89 deletions
diff --git a/libc/string/generic/memchr.c b/libc/string/generic/memchr.c
index bc0623f3f..68c820814 100644
--- a/libc/string/generic/memchr.c
+++ b/libc/string/generic/memchr.c
@@ -29,8 +29,6 @@
#define LONG_MAX_32_BITS 2147483647
-#undef memchr
-
/* Search no more than N bytes of S for C. */
void attribute_hidden *__memchr (const void * s, int c_in, size_t n)
{
@@ -174,4 +172,4 @@ void attribute_hidden *__memchr (const void * s, int c_in, size_t n)
return 0;
}
-strong_alias(__memchr, memchr)
+strong_alias(__memchr,memchr)
diff --git a/libc/string/generic/memcmp.c b/libc/string/generic/memcmp.c
index a3fcba036..13e11692a 100644
--- a/libc/string/generic/memcmp.c
+++ b/libc/string/generic/memcmp.c
@@ -20,8 +20,6 @@
#include <string.h>
-#undef memcmp
-
#include "memcopy.h"
#include <endian.h>
@@ -332,6 +330,6 @@ attribute_hidden __memcmp (const __ptr_t s1, const __ptr_t s2, size_t len)
return 0;
}
-strong_alias(__memcmp, memcmp)
+strong_alias(__memcmp,memcmp)
-weak_alias(memcmp, bcmp)
+strong_alias(__memcmp,bcmp)
diff --git a/libc/string/generic/memcpy.c b/libc/string/generic/memcpy.c
index 2fb48ebef..6db4d0d44 100644
--- a/libc/string/generic/memcpy.c
+++ b/libc/string/generic/memcpy.c
@@ -23,8 +23,6 @@
#include "memcopy.h"
#include "pagecopy.h"
-#undef memcpy
-
/* _wordcopy_fwd_aligned -- Copy block beginning at SRCP to
block beginning at DSTP with LEN `op_t' words (not LEN bytes!).
Both SRCP and DSTP should be aligned for memory operations on `op_t's. */
@@ -245,4 +243,4 @@ void attribute_hidden *__memcpy (void *dstpp, const void *srcpp, size_t len)
return dstpp;
}
-strong_alias(__memcpy, memcpy)
+strong_alias(__memcpy,memcpy)
diff --git a/libc/string/generic/memmem.c b/libc/string/generic/memmem.c
index 05d7de639..0353759e3 100644
--- a/libc/string/generic/memmem.c
+++ b/libc/string/generic/memmem.c
@@ -19,8 +19,6 @@
#include <string.h>
#include <stddef.h>
-#undef memmem
-
/* Return the first occurrence of NEEDLE in HAYSTACK. */
void attribute_hidden *__memmem (const void *haystack, size_t haystack_len,
const void *needle, size_t needle_len)
@@ -49,4 +47,4 @@ void attribute_hidden *__memmem (const void *haystack, size_t haystack_len,
return NULL;
}
-strong_alias(__memmem, memmem)
+strong_alias(__memmem,memmem)
diff --git a/libc/string/generic/memmove.c b/libc/string/generic/memmove.c
index 0e649a1a9..e34b0005d 100644
--- a/libc/string/generic/memmove.c
+++ b/libc/string/generic/memmove.c
@@ -206,8 +206,6 @@ static void _wordcopy_bwd_dest_aligned (long int dstp, long int srcp, size_t len
((op_t *) dstp)[3] = MERGE (a0, sh_1, a1, sh_2);
}
-#undef memmove
-
void attribute_hidden *__memmove (void *dest, const void *src, size_t len)
{
unsigned long int dstp = (long int) dest;
@@ -279,4 +277,4 @@ void attribute_hidden *__memmove (void *dest, const void *src, size_t len)
return (dest);
}
-strong_alias(__memmove, memmove)
+strong_alias(__memmove,memmove)
diff --git a/libc/string/generic/mempcpy.c b/libc/string/generic/mempcpy.c
index f2c860107..d121967cd 100644
--- a/libc/string/generic/mempcpy.c
+++ b/libc/string/generic/mempcpy.c
@@ -7,8 +7,6 @@
#include <string.h>
-#undef mempcpy
-
void attribute_hidden *__mempcpy (void *dstpp, const void *srcpp, size_t len)
{
__memcpy(dstpp, srcpp, len);
diff --git a/libc/string/generic/memrchr.c b/libc/string/generic/memrchr.c
index 3f7583919..d27ae03ef 100644
--- a/libc/string/generic/memrchr.c
+++ b/libc/string/generic/memrchr.c
@@ -30,8 +30,6 @@
#define LONG_MAX_32_BITS 2147483647
-#undef memrchr
-
/* Search no more than N bytes of S for C. */
void attribute_hidden *__memrchr (const void * s, int c_in, size_t n)
{
@@ -173,4 +171,4 @@ void attribute_hidden *__memrchr (const void * s, int c_in, size_t n)
return 0;
}
-strong_alias(__memrchr, memrchr)
+strong_alias(__memrchr,memrchr)
diff --git a/libc/string/generic/memset.c b/libc/string/generic/memset.c
index 0185ad57b..91401d7ee 100644
--- a/libc/string/generic/memset.c
+++ b/libc/string/generic/memset.c
@@ -19,8 +19,6 @@
#include <string.h>
#include "memcopy.h"
-#undef memset
-
void attribute_hidden *__memset (void *dstpp, int c, size_t len)
{
long int dstp = (long int) dstpp;
@@ -85,4 +83,4 @@ void attribute_hidden *__memset (void *dstpp, int c, size_t len)
return dstpp;
}
-strong_alias(__memset, memset)
+strong_alias(__memset,memset)
diff --git a/libc/string/generic/rawmemchr.c b/libc/string/generic/rawmemchr.c
index 02cb8f629..d1be620eb 100644
--- a/libc/string/generic/rawmemchr.c
+++ b/libc/string/generic/rawmemchr.c
@@ -29,8 +29,6 @@
#define LONG_MAX_32_BITS 2147483647
-#undef rawmemchr
-
/* Find the first occurrence of C in S. */
void attribute_hidden *__rawmemchr (const void * s, int c_in)
{
@@ -159,4 +157,4 @@ void attribute_hidden *__rawmemchr (const void * s, int c_in)
}
}
-strong_alias(__rawmemchr, rawmemchr)
+strong_alias(__rawmemchr,rawmemchr)
diff --git a/libc/string/generic/strcat.c b/libc/string/generic/strcat.c
index 0996f9a29..96412acc5 100644
--- a/libc/string/generic/strcat.c
+++ b/libc/string/generic/strcat.c
@@ -19,8 +19,6 @@
#include <string.h>
#include "memcopy.h"
-#undef strcat
-
/* Append SRC on the end of DEST. */
char attribute_hidden *__strcat (char *dest, const char *src)
{
@@ -47,4 +45,4 @@ char attribute_hidden *__strcat (char *dest, const char *src)
return dest;
}
-strong_alias(__strcat, strcat)
+strong_alias(__strcat,strcat)
diff --git a/libc/string/generic/strchr.c b/libc/string/generic/strchr.c
index c776380e2..dcb30ad7b 100644
--- a/libc/string/generic/strchr.c
+++ b/libc/string/generic/strchr.c
@@ -26,8 +26,6 @@
#include "memcopy.h"
-#undef strchr
-
/* Find the first occurrence of C in S. */
char attribute_hidden *__strchr (const char *s, int c_in)
{
@@ -181,6 +179,6 @@ char attribute_hidden *__strchr (const char *s, int c_in)
return NULL;
}
-strong_alias(__strchr, strchr)
+strong_alias(__strchr,strchr)
-weak_alias(strchr, index)
+strong_alias(__strchr,index)
diff --git a/libc/string/generic/strchrnul.c b/libc/string/generic/strchrnul.c
index faa0f4ff9..a2aafbfb0 100644
--- a/libc/string/generic/strchrnul.c
+++ b/libc/string/generic/strchrnul.c
@@ -26,8 +26,6 @@
#include "memcopy.h"
-#undef strchrnul
-
/* Find the first occurrence of C in S or the final NUL byte. */
char attribute_hidden *__strchrnul (const char *s, int c_in)
{
@@ -164,4 +162,4 @@ char attribute_hidden *__strchrnul (const char *s, int c_in)
return NULL;
}
-strong_alias(__strchrnul, strchrnul)
+strong_alias(__strchrnul,strchrnul)
diff --git a/libc/string/generic/strcmp.c b/libc/string/generic/strcmp.c
index f12424243..209aeed15 100644
--- a/libc/string/generic/strcmp.c
+++ b/libc/string/generic/strcmp.c
@@ -17,12 +17,9 @@
02111-1307 USA. */
#include <string.h>
-#include <locale.h>
#include "memcopy.h"
-#undef strcmp
-
/* Compare S1 and S2, returning less than, equal to or
greater than zero if S1 is lexicographically less than,
equal to or greater than S2. */
@@ -44,9 +41,9 @@ int attribute_hidden __strcmp (const char *p1, const char *p2)
return c1 - c2;
}
-strong_alias(__strcmp, strcmp)
+strong_alias(__strcmp,strcmp)
-#ifdef __LOCALE_C_ONLY
-hidden_strong_alias(__strcmp, __strcoll)
-strong_alias(__strcmp, strcoll)
-#endif /* __LOCALE_C_ONLY */
+#ifndef __UCLIBC_HAS_LOCALE__
+hidden_strong_alias(__strcmp,__strcoll)
+strong_alias(__strcmp,strcoll)
+#endif
diff --git a/libc/string/generic/strcpy.c b/libc/string/generic/strcpy.c
index 08c810f31..9280d3561 100644
--- a/libc/string/generic/strcpy.c
+++ b/libc/string/generic/strcpy.c
@@ -22,8 +22,6 @@
#include "memcopy.h"
#include "bp-checks.h"
-#undef strcpy
-
/* Copy SRC to DEST. */
char attribute_hidden *__strcpy (char *dest, const char *src)
{
@@ -46,4 +44,4 @@ char attribute_hidden *__strcpy (char *dest, const char *src)
return dest;
}
-strong_alias(__strcpy, strcpy)
+strong_alias(__strcpy,strcpy)
diff --git a/libc/string/generic/strcspn.c b/libc/string/generic/strcspn.c
index a10912e25..a06577bca 100644
--- a/libc/string/generic/strcspn.c
+++ b/libc/string/generic/strcspn.c
@@ -18,8 +18,6 @@
#include <string.h>
-#undef strcspn
-
/* Return the length of the maximum initial segment of S
which contains no characters from REJECT. */
size_t attribute_hidden __strcspn (const char *s, const char *reject)
@@ -35,4 +33,4 @@ size_t attribute_hidden __strcspn (const char *s, const char *reject)
return count;
}
-strong_alias(__strcspn, strcspn)
+strong_alias(__strcspn,strcspn)
diff --git a/libc/string/generic/strlen.c b/libc/string/generic/strlen.c
index aca8c2bd9..6c1b5eae3 100644
--- a/libc/string/generic/strlen.c
+++ b/libc/string/generic/strlen.c
@@ -22,8 +22,6 @@
#include <string.h>
#include <stdlib.h>
-#undef strlen
-
/* Return the length of the null-terminated string STR. Scan for
the null terminator quickly by testing four bytes at a time. */
size_t attribute_hidden __strlen (const char *str)
@@ -149,4 +147,4 @@ size_t attribute_hidden __strlen (const char *str)
}
}
-strong_alias(__strlen, strlen)
+strong_alias(__strlen,strlen)
diff --git a/libc/string/generic/strncat.c b/libc/string/generic/strncat.c
index f35e0865b..5ece4d248 100644
--- a/libc/string/generic/strncat.c
+++ b/libc/string/generic/strncat.c
@@ -20,8 +20,6 @@
#include "memcopy.h"
-#undef strncat
-
char attribute_hidden *__strncat (char *s1, const char *s2, size_t n)
{
reg_char c;
@@ -76,4 +74,4 @@ char attribute_hidden *__strncat (char *s1, const char *s2, size_t n)
return s;
}
-strong_alias(__strncat, strncat)
+strong_alias(__strncat,strncat)
diff --git a/libc/string/generic/strncmp.c b/libc/string/generic/strncmp.c
index 22aa179b0..849726f6b 100644
--- a/libc/string/generic/strncmp.c
+++ b/libc/string/generic/strncmp.c
@@ -19,8 +19,6 @@
#include <string.h>
#include "memcopy.h"
-#undef strncmp
-
/* Compare no more than N characters of S1 and S2,
returning less than, equal to or greater than zero
if S1 is lexicographically less than, equal to or
@@ -67,4 +65,4 @@ int attribute_hidden __strncmp (const char *s1, const char *s2, size_t n)
return c1 - c2;
}
-strong_alias(__strncmp, strncmp)
+strong_alias(__strncmp,strncmp)
diff --git a/libc/string/generic/strncpy.c b/libc/string/generic/strncpy.c
index a43c48502..ca4f59e52 100644
--- a/libc/string/generic/strncpy.c
+++ b/libc/string/generic/strncpy.c
@@ -19,8 +19,6 @@
#include <string.h>
#include "memcopy.h"
-#undef strncpy
-
char attribute_hidden *__strncpy (char *s1, const char *s2, size_t n)
{
reg_char c;
@@ -81,4 +79,4 @@ char attribute_hidden *__strncpy (char *s1, const char *s2, size_t n)
return s;
}
-strong_alias(__strncpy, strncpy)
+strong_alias(__strncpy,strncpy)
diff --git a/libc/string/generic/strnlen.c b/libc/string/generic/strnlen.c
index ff5c13739..4b96dde31 100644
--- a/libc/string/generic/strnlen.c
+++ b/libc/string/generic/strnlen.c
@@ -24,8 +24,6 @@
#include <string.h>
#include <stdlib.h>
-#undef strnlen
-
/* Find the length of S, but scan at most MAXLEN characters. If no
'\0' terminator is found in that many characters, return MAXLEN. */
size_t attribute_hidden __strnlen (const char *str, size_t maxlen)
@@ -159,4 +157,4 @@ size_t attribute_hidden __strnlen (const char *str, size_t maxlen)
return char_ptr - str;
}
-strong_alias(__strnlen, strnlen)
+strong_alias(__strnlen,strnlen)
diff --git a/libc/string/generic/strrchr.c b/libc/string/generic/strrchr.c
index 325be7d48..529016ede 100644
--- a/libc/string/generic/strrchr.c
+++ b/libc/string/generic/strrchr.c
@@ -18,8 +18,6 @@
#include <string.h>
-#undef strrchr
-
/* Find the last occurrence of C in S. */
char attribute_hidden *__strrchr (const char *s, int c)
{
@@ -42,6 +40,6 @@ char attribute_hidden *__strrchr (const char *s, int c)
return (char *) found;
}
-strong_alias(__strrchr, strrchr)
+strong_alias(__strrchr,strrchr)
-weak_alias (strrchr, rindex)
+strong_alias (__strrchr,rindex)
diff --git a/libc/string/generic/strsep.c b/libc/string/generic/strsep.c
index 9515fa193..762b07ff9 100644
--- a/libc/string/generic/strsep.c
+++ b/libc/string/generic/strsep.c
@@ -20,8 +20,6 @@
#include <string.h>
-#undef strsep
-
char attribute_hidden *__strsep (char **stringp, const char *delim)
{
char *begin, *end;
@@ -66,4 +64,4 @@ char attribute_hidden *__strsep (char **stringp, const char *delim)
return begin;
}
-strong_alias(__strsep, strsep)
+strong_alias(__strsep,strsep)
diff --git a/libc/string/generic/strspn.c b/libc/string/generic/strspn.c
index 1923f8afd..129c58742 100644
--- a/libc/string/generic/strspn.c
+++ b/libc/string/generic/strspn.c
@@ -18,8 +18,6 @@
#include <string.h>
-#undef strspn
-
/* Return the length of the maximum initial segment
of S which contains only characters in ACCEPT. */
size_t attribute_hidden __strspn (const char *s, const char *accept)
@@ -42,4 +40,4 @@ size_t attribute_hidden __strspn (const char *s, const char *accept)
return count;
}
-strong_alias(__strspn, strspn)
+strong_alias(__strspn,strspn)
diff --git a/libc/string/generic/strstr.c b/libc/string/generic/strstr.c
index b16261e56..12e384014 100644
--- a/libc/string/generic/strstr.c
+++ b/libc/string/generic/strstr.c
@@ -30,8 +30,6 @@
typedef unsigned chartype;
-#undef strstr
-
char attribute_hidden *__strstr (const char *phaystack, const char *pneedle)
{
const unsigned char *haystack, *needle;
@@ -112,4 +110,4 @@ ret0:
return 0;
}
-strong_alias(__strstr, strstr)
+strong_alias(__strstr,strstr)
diff --git a/libc/string/generic/strtok_r.c b/libc/string/generic/strtok_r.c
index 56eb64bb9..1a11166dd 100644
--- a/libc/string/generic/strtok_r.c
+++ b/libc/string/generic/strtok_r.c
@@ -17,15 +17,9 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#define rawmemchr __rawmemchr
-#define strspn __strspn
-#define strpbrk __strpbrk
-
#define _GNU_SOURCE
#include <string.h>
-#undef strtok_r
-
/* Parse S into tokens separated by characters in DELIM.
If S is NULL, the saved pointer in SAVE_PTR is used as
the next starting point. For example:
@@ -44,7 +38,7 @@ char attribute_hidden *__strtok_r (char *s, const char *delim, char **save_ptr)
s = *save_ptr;
/* Scan leading delimiters. */
- s += strspn (s, delim);
+ s += __strspn (s, delim);
if (*s == '\0')
{
*save_ptr = s;
@@ -53,10 +47,10 @@ char attribute_hidden *__strtok_r (char *s, const char *delim, char **save_ptr)
/* Find the end of the token. */
token = s;
- s = strpbrk (token, delim);
+ s = __strpbrk (token, delim);
if (s == NULL)
/* This token finishes the string. */
- *save_ptr = rawmemchr (token, '\0');
+ *save_ptr = __rawmemchr (token, '\0');
else
{
/* Terminate the token and make *SAVE_PTR point past it. */
@@ -66,4 +60,4 @@ char attribute_hidden *__strtok_r (char *s, const char *delim, char **save_ptr)
return token;
}
-strong_alias(__strtok_r, strtok_r)
+strong_alias(__strtok_r,strtok_r)