summaryrefslogtreecommitdiff
path: root/libc/string/generic
diff options
context:
space:
mode:
Diffstat (limited to 'libc/string/generic')
-rw-r--r--libc/string/generic/memchr.c2
-rw-r--r--libc/string/generic/memcmp.c4
-rw-r--r--libc/string/generic/memcpy.c3
-rw-r--r--libc/string/generic/memmem.c3
-rw-r--r--libc/string/generic/memmove.c2
-rw-r--r--libc/string/generic/mempcpy.c3
-rw-r--r--libc/string/generic/memrchr.c3
-rw-r--r--libc/string/generic/memset.c2
-rw-r--r--libc/string/generic/rawmemchr.c3
-rw-r--r--libc/string/generic/strcat.c2
-rw-r--r--libc/string/generic/strchr.c2
-rw-r--r--libc/string/generic/strchrnul.c3
-rw-r--r--libc/string/generic/strcmp.c2
-rw-r--r--libc/string/generic/strcpy.c2
-rw-r--r--libc/string/generic/strcspn.c2
-rw-r--r--libc/string/generic/strlen.c2
-rw-r--r--libc/string/generic/strncat.c2
-rw-r--r--libc/string/generic/strncmp.c2
-rw-r--r--libc/string/generic/strncpy.c2
-rw-r--r--libc/string/generic/strnlen.c3
-rw-r--r--libc/string/generic/strrchr.c2
-rw-r--r--libc/string/generic/strsep.c2
-rw-r--r--libc/string/generic/strspn.c2
-rw-r--r--libc/string/generic/strstr.c3
-rw-r--r--libc/string/generic/strtok_r.c2
25 files changed, 34 insertions, 26 deletions
diff --git a/libc/string/generic/memchr.c b/libc/string/generic/memchr.c
index 9942b609b..4bda5d758 100644
--- a/libc/string/generic/memchr.c
+++ b/libc/string/generic/memchr.c
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <limits.h>
+libc_hidden_proto(memchr)
libc_hidden_proto(abort)
#include "memcopy.h"
@@ -173,5 +174,4 @@ void *memchr (const void * s, int c_in, size_t n)
return 0;
}
-libc_hidden_proto(memchr)
libc_hidden_def(memchr)
diff --git a/libc/string/generic/memcmp.c b/libc/string/generic/memcmp.c
index 13de370bb..41f15369d 100644
--- a/libc/string/generic/memcmp.c
+++ b/libc/string/generic/memcmp.c
@@ -19,9 +19,10 @@
02111-1307 USA. */
#include <string.h>
-
#include "memcopy.h"
+libc_hidden_proto(memcmp)
+
#include <endian.h>
#if __BYTE_ORDER == __BIG_ENDIAN
@@ -329,6 +330,5 @@ memcmp (const __ptr_t s1, const __ptr_t s2, size_t len)
return 0;
}
-libc_hidden_proto(memcmp)
libc_hidden_def(memcmp)
strong_alias(memcmp,bcmp)
diff --git a/libc/string/generic/memcpy.c b/libc/string/generic/memcpy.c
index 692a254f7..42e97a063 100644
--- a/libc/string/generic/memcpy.c
+++ b/libc/string/generic/memcpy.c
@@ -23,6 +23,8 @@
#include "memcopy.h"
#include "pagecopy.h"
+libc_hidden_proto(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. */
@@ -242,5 +244,4 @@ void *memcpy (void *dstpp, const void *srcpp, size_t len)
return dstpp;
}
-libc_hidden_proto(memcpy)
libc_hidden_def(memcpy)
diff --git a/libc/string/generic/memmem.c b/libc/string/generic/memmem.c
index e8982c078..386cb5e02 100644
--- a/libc/string/generic/memmem.c
+++ b/libc/string/generic/memmem.c
@@ -16,9 +16,11 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#define _GNU_SOURCE
#include <string.h>
#include <stddef.h>
+libc_hidden_proto(memmem)
libc_hidden_proto(memcmp)
/* Return the first occurrence of NEEDLE in HAYSTACK. */
@@ -48,5 +50,4 @@ void *memmem (const void *haystack, size_t haystack_len,
return NULL;
}
-libc_hidden_proto(memmem)
libc_hidden_def(memmem)
diff --git a/libc/string/generic/memmove.c b/libc/string/generic/memmove.c
index 0157b148c..68caacd78 100644
--- a/libc/string/generic/memmove.c
+++ b/libc/string/generic/memmove.c
@@ -24,6 +24,7 @@
#include "memcopy.h"
#include "pagecopy.h"
+libc_hidden_proto(memmove)
libc_hidden_proto(memcpy)
static void _wordcopy_bwd_aligned (long int dstp, long int srcp, size_t len)
@@ -278,5 +279,4 @@ void *memmove (void *dest, const void *src, size_t len)
return (dest);
}
-libc_hidden_proto(memmove)
libc_hidden_def(memmove)
diff --git a/libc/string/generic/mempcpy.c b/libc/string/generic/mempcpy.c
index ea4dec2b1..ac91541a5 100644
--- a/libc/string/generic/mempcpy.c
+++ b/libc/string/generic/mempcpy.c
@@ -5,8 +5,10 @@
/* Ditch the glibc version and just wrap memcpy. */
+#define _GNU_SOURCE
#include <string.h>
+libc_hidden_proto(mempcpy)
libc_hidden_proto(memcpy)
void *mempcpy (void *dstpp, const void *srcpp, size_t len)
@@ -14,5 +16,4 @@ void *mempcpy (void *dstpp, const void *srcpp, size_t len)
memcpy(dstpp, srcpp, len);
return (void *)(((char *)dstpp) + len);
}
-libc_hidden_proto(mempcpy)
libc_hidden_def(mempcpy)
diff --git a/libc/string/generic/memrchr.c b/libc/string/generic/memrchr.c
index ab61eac72..7cb5b2246 100644
--- a/libc/string/generic/memrchr.c
+++ b/libc/string/generic/memrchr.c
@@ -22,10 +22,12 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <limits.h>
+libc_hidden_proto(memrchr)
libc_hidden_proto(abort)
#include "memcopy.h"
@@ -172,5 +174,4 @@ void *memrchr (const void * s, int c_in, size_t n)
return 0;
}
-libc_hidden_proto(memrchr)
libc_hidden_def(memrchr)
diff --git a/libc/string/generic/memset.c b/libc/string/generic/memset.c
index 18c065cac..1df1a450f 100644
--- a/libc/string/generic/memset.c
+++ b/libc/string/generic/memset.c
@@ -19,6 +19,7 @@
#include <string.h>
#include "memcopy.h"
+libc_hidden_proto(memset)
void *memset (void *dstpp, int c, size_t len)
{
long int dstp = (long int) dstpp;
@@ -82,5 +83,4 @@ void *memset (void *dstpp, int c, size_t len)
return dstpp;
}
-libc_hidden_proto(memset)
libc_hidden_def(memset)
diff --git a/libc/string/generic/rawmemchr.c b/libc/string/generic/rawmemchr.c
index 3fc0e52f3..3c1cc01de 100644
--- a/libc/string/generic/rawmemchr.c
+++ b/libc/string/generic/rawmemchr.c
@@ -21,10 +21,12 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <limits.h>
+libc_hidden_proto(rawmemchr)
libc_hidden_proto(abort)
#include "memcopy.h"
@@ -158,5 +160,4 @@ void *rawmemchr (const void * s, int c_in)
}
}
}
-libc_hidden_proto(rawmemchr)
libc_hidden_def(rawmemchr)
diff --git a/libc/string/generic/strcat.c b/libc/string/generic/strcat.c
index 5111a9a0f..53c4d0d9e 100644
--- a/libc/string/generic/strcat.c
+++ b/libc/string/generic/strcat.c
@@ -19,6 +19,7 @@
#include <string.h>
#include "memcopy.h"
+libc_hidden_proto(strcat)
/* Append SRC on the end of DEST. */
char *strcat (char *dest, const char *src)
{
@@ -44,5 +45,4 @@ char *strcat (char *dest, const char *src)
return dest;
}
-libc_hidden_proto(strcat)
libc_hidden_def(strcat)
diff --git a/libc/string/generic/strchr.c b/libc/string/generic/strchr.c
index 5675ce4ba..b1ffc7538 100644
--- a/libc/string/generic/strchr.c
+++ b/libc/string/generic/strchr.c
@@ -24,6 +24,7 @@
#include <string.h>
#include <stdlib.h>
+libc_hidden_proto(strchr)
libc_hidden_proto(abort)
#include "memcopy.h"
@@ -180,6 +181,5 @@ char *strchr (const char *s, int c_in)
return NULL;
}
-libc_hidden_proto(strchr)
libc_hidden_def(strchr)
strong_alias(strchr,index)
diff --git a/libc/string/generic/strchrnul.c b/libc/string/generic/strchrnul.c
index eccdba247..3616341a7 100644
--- a/libc/string/generic/strchrnul.c
+++ b/libc/string/generic/strchrnul.c
@@ -21,9 +21,11 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
+libc_hidden_proto(strchrnul)
libc_hidden_proto(abort)
#include "memcopy.h"
@@ -163,5 +165,4 @@ char *strchrnul (const char *s, int c_in)
/* This should never happen. */
return NULL;
}
-libc_hidden_proto(strchrnul)
libc_hidden_def(strchrnul)
diff --git a/libc/string/generic/strcmp.c b/libc/string/generic/strcmp.c
index 1049934a8..6edb503e1 100644
--- a/libc/string/generic/strcmp.c
+++ b/libc/string/generic/strcmp.c
@@ -20,6 +20,7 @@
#include "memcopy.h"
+libc_hidden_proto(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. */
@@ -40,7 +41,6 @@ int strcmp (const char *p1, const char *p2)
return c1 - c2;
}
-libc_hidden_proto(strcmp)
libc_hidden_def(strcmp)
#ifndef __UCLIBC_HAS_LOCALE__
diff --git a/libc/string/generic/strcpy.c b/libc/string/generic/strcpy.c
index ab2928e55..7e558ead1 100644
--- a/libc/string/generic/strcpy.c
+++ b/libc/string/generic/strcpy.c
@@ -22,6 +22,7 @@
#include "memcopy.h"
#include "bp-checks.h"
+libc_hidden_proto(strcpy)
/* Copy SRC to DEST. */
char *strcpy (char *dest, const char *src)
{
@@ -43,5 +44,4 @@ char *strcpy (char *dest, const char *src)
return dest;
}
-libc_hidden_proto(strcpy)
libc_hidden_def(strcpy)
diff --git a/libc/string/generic/strcspn.c b/libc/string/generic/strcspn.c
index 7fa49a0dc..1b5e465ea 100644
--- a/libc/string/generic/strcspn.c
+++ b/libc/string/generic/strcspn.c
@@ -18,6 +18,7 @@
#include <string.h>
+libc_hidden_proto(strcspn)
libc_hidden_proto(strchr)
/* Return the length of the maximum initial segment of S
@@ -34,5 +35,4 @@ size_t strcspn (const char *s, const char *reject)
return count;
}
-libc_hidden_proto(strcspn)
libc_hidden_def(strcspn)
diff --git a/libc/string/generic/strlen.c b/libc/string/generic/strlen.c
index 08b5fa830..3528829af 100644
--- a/libc/string/generic/strlen.c
+++ b/libc/string/generic/strlen.c
@@ -22,6 +22,7 @@
#include <string.h>
#include <stdlib.h>
+libc_hidden_proto(strlen)
libc_hidden_proto(abort)
/* Return the length of the null-terminated string STR. Scan for
@@ -148,5 +149,4 @@ size_t strlen (const char *str)
}
}
}
-libc_hidden_proto(strlen)
libc_hidden_def(strlen)
diff --git a/libc/string/generic/strncat.c b/libc/string/generic/strncat.c
index 0cdb21a7a..9e0dfcd78 100644
--- a/libc/string/generic/strncat.c
+++ b/libc/string/generic/strncat.c
@@ -20,6 +20,7 @@
#include "memcopy.h"
+libc_hidden_proto(strncat)
char *strncat (char *s1, const char *s2, size_t n)
{
reg_char c;
@@ -73,5 +74,4 @@ char *strncat (char *s1, const char *s2, size_t n)
return s;
}
-libc_hidden_proto(strncat)
libc_hidden_def(strncat)
diff --git a/libc/string/generic/strncmp.c b/libc/string/generic/strncmp.c
index a6285e3a4..4c1978439 100644
--- a/libc/string/generic/strncmp.c
+++ b/libc/string/generic/strncmp.c
@@ -19,6 +19,7 @@
#include <string.h>
#include "memcopy.h"
+libc_hidden_proto(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
@@ -64,5 +65,4 @@ int strncmp (const char *s1, const char *s2, size_t n)
return c1 - c2;
}
-libc_hidden_proto(strncmp)
libc_hidden_def(strncmp)
diff --git a/libc/string/generic/strncpy.c b/libc/string/generic/strncpy.c
index 3c9ccb9ce..4b0b0894e 100644
--- a/libc/string/generic/strncpy.c
+++ b/libc/string/generic/strncpy.c
@@ -19,6 +19,7 @@
#include <string.h>
#include "memcopy.h"
+libc_hidden_proto(strncpy)
char *strncpy (char *s1, const char *s2, size_t n)
{
reg_char c;
@@ -78,5 +79,4 @@ char *strncpy (char *s1, const char *s2, size_t n)
return s;
}
-libc_hidden_proto(strncpy)
libc_hidden_def(strncpy)
diff --git a/libc/string/generic/strnlen.c b/libc/string/generic/strnlen.c
index 95e8a77be..c5da906ef 100644
--- a/libc/string/generic/strnlen.c
+++ b/libc/string/generic/strnlen.c
@@ -21,9 +21,11 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
+libc_hidden_proto(strnlen)
libc_hidden_proto(abort)
/* Find the length of S, but scan at most MAXLEN characters. If no
@@ -158,5 +160,4 @@ size_t strnlen (const char *str, size_t maxlen)
char_ptr = end_ptr;
return char_ptr - str;
}
-libc_hidden_proto(strnlen)
libc_hidden_def(strnlen)
diff --git a/libc/string/generic/strrchr.c b/libc/string/generic/strrchr.c
index cf4c6dd3b..b67e369fd 100644
--- a/libc/string/generic/strrchr.c
+++ b/libc/string/generic/strrchr.c
@@ -18,6 +18,7 @@
#include <string.h>
+libc_hidden_proto(strrchr)
libc_hidden_proto(strchr)
/* Find the last occurrence of C in S. */
@@ -41,6 +42,5 @@ char *strrchr (const char *s, int c)
return (char *) found;
}
-libc_hidden_proto(strrchr)
libc_hidden_def(strrchr)
strong_alias(strrchr,rindex)
diff --git a/libc/string/generic/strsep.c b/libc/string/generic/strsep.c
index 5d9c8c307..7b34e2c16 100644
--- a/libc/string/generic/strsep.c
+++ b/libc/string/generic/strsep.c
@@ -18,6 +18,7 @@
#include <string.h>
+libc_hidden_proto(strsep)
libc_hidden_proto(strchr)
libc_hidden_proto(strpbrk)
@@ -64,5 +65,4 @@ char *strsep (char **stringp, const char *delim)
return begin;
}
-libc_hidden_proto(strsep)
libc_hidden_def(strsep)
diff --git a/libc/string/generic/strspn.c b/libc/string/generic/strspn.c
index cd2882456..a194fdc7d 100644
--- a/libc/string/generic/strspn.c
+++ b/libc/string/generic/strspn.c
@@ -18,6 +18,7 @@
#include <string.h>
+libc_hidden_proto(strspn)
/* Return the length of the maximum initial segment
of S which contains only characters in ACCEPT. */
size_t strspn (const char *s, const char *accept)
@@ -39,5 +40,4 @@ size_t strspn (const char *s, const char *accept)
return count;
}
-libc_hidden_proto(strspn)
libc_hidden_def(strspn)
diff --git a/libc/string/generic/strstr.c b/libc/string/generic/strstr.c
index a7442d614..f151a820a 100644
--- a/libc/string/generic/strstr.c
+++ b/libc/string/generic/strstr.c
@@ -28,6 +28,8 @@
#include <string.h>
+libc_hidden_proto(strstr)
+
typedef unsigned chartype;
char *strstr (const char *phaystack, const char *pneedle)
@@ -109,5 +111,4 @@ foundneedle:
ret0:
return 0;
}
-libc_hidden_proto(strstr)
libc_hidden_def(strstr)
diff --git a/libc/string/generic/strtok_r.c b/libc/string/generic/strtok_r.c
index 3f7ed2c9f..566538fd5 100644
--- a/libc/string/generic/strtok_r.c
+++ b/libc/string/generic/strtok_r.c
@@ -20,6 +20,7 @@
#define _GNU_SOURCE
#include <string.h>
+libc_hidden_proto(strtok_r)
libc_hidden_proto(strspn)
libc_hidden_proto(strpbrk)
libc_hidden_proto(rawmemchr)
@@ -63,5 +64,4 @@ char *strtok_r (char *s, const char *delim, char **save_ptr)
}
return token;
}
-libc_hidden_proto(strtok_r)
libc_hidden_def(strtok_r)