summaryrefslogtreecommitdiffstats
path: root/libc/string
diff options
context:
space:
mode:
Diffstat (limited to 'libc/string')
-rw-r--r--libc/string/__glibc_strerror_r.c4
-rw-r--r--libc/string/__xpg_strerror_r.c2
-rw-r--r--libc/string/_collate.c12
-rw-r--r--libc/string/memchr.c2
-rw-r--r--libc/string/memcpy.c2
-rw-r--r--libc/string/mempcpy.c2
-rw-r--r--libc/string/strcasecmp.c12
-rw-r--r--libc/string/strcasestr.c2
-rw-r--r--libc/string/strcat.c2
-rw-r--r--libc/string/strchr.c2
-rw-r--r--libc/string/strchrnul.c2
-rw-r--r--libc/string/strcmp.c3
-rw-r--r--libc/string/strcpy.c9
-rw-r--r--libc/string/strdup.c2
-rw-r--r--libc/string/strerror.c2
-rw-r--r--libc/string/strlcpy.c21
-rw-r--r--libc/string/strlen.c2
-rw-r--r--libc/string/strncasecmp.c12
-rw-r--r--libc/string/strnlen.c2
-rw-r--r--libc/string/strpbrk.c2
-rw-r--r--libc/string/strspn.c2
-rw-r--r--libc/string/strtok_r.c4
22 files changed, 42 insertions, 63 deletions
diff --git a/libc/string/__glibc_strerror_r.c b/libc/string/__glibc_strerror_r.c
index 0f9cd16a9..2b856e9f5 100644
--- a/libc/string/__glibc_strerror_r.c
+++ b/libc/string/__glibc_strerror_r.c
@@ -8,8 +8,8 @@
#include <features.h>
#include <string.h>
-libc_hidden_proto(__glibc_strerror_r)
-libc_hidden_proto(__xpg_strerror_r)
+/* libc_hidden_proto(__glibc_strerror_r) */
+/* libc_hidden_proto(__xpg_strerror_r) */
char *__glibc_strerror_r(int errnum, char *strerrbuf, size_t buflen)
{
diff --git a/libc/string/__xpg_strerror_r.c b/libc/string/__xpg_strerror_r.c
index ff41192e5..274b6cec8 100644
--- a/libc/string/__xpg_strerror_r.c
+++ b/libc/string/__xpg_strerror_r.c
@@ -15,7 +15,7 @@
#undef strerror_r
-libc_hidden_proto(__xpg_strerror_r)
+/* libc_hidden_proto(__xpg_strerror_r) */
/* Experimentally off - libc_hidden_proto(memcpy) */
/* Experimentally off - libc_hidden_proto(strlen) */
diff --git a/libc/string/_collate.c b/libc/string/_collate.c
index 64b5d9608..3c53404ad 100644
--- a/libc/string/_collate.c
+++ b/libc/string/_collate.c
@@ -24,8 +24,8 @@
/* Experimentally off - libc_hidden_proto(strlcpy) */
/* Experimentally off - libc_hidden_proto(strcmp) */
#ifdef WANT_WIDE
-libc_hidden_proto(wcsxfrm)
-libc_hidden_proto(wcscmp)
+/* libc_hidden_proto(wcsxfrm) */
+/* libc_hidden_proto(wcscmp) */
#endif
#ifdef __UCLIBC_HAS_LOCALE__
@@ -59,18 +59,18 @@ libc_hidden_proto(wcscmp)
#if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE)
-libc_hidden_proto(wcscoll_l)
+/* libc_hidden_proto(wcscoll_l) */
-libc_hidden_proto(wcscoll)
+/* libc_hidden_proto(wcscoll) */
int wcscoll (const Wchar *s0, const Wchar *s1)
{
return wcscoll_l(s0, s1, __UCLIBC_CURLOCALE );
}
libc_hidden_def(wcscoll)
-libc_hidden_proto(wcsxfrm_l)
+/* libc_hidden_proto(wcsxfrm_l) */
-libc_hidden_proto(wcsxfrm)
+/* libc_hidden_proto(wcsxfrm) */
size_t wcsxfrm(Wchar *__restrict ws1, const Wchar *__restrict ws2, size_t n)
{
return wcsxfrm_l(ws1, ws2, n, __UCLIBC_CURLOCALE );
diff --git a/libc/string/memchr.c b/libc/string/memchr.c
index 413999722..5e60f6554 100644
--- a/libc/string/memchr.c
+++ b/libc/string/memchr.c
@@ -13,8 +13,6 @@
# define Wmemchr memchr
#endif
-libc_hidden_proto(Wmemchr)
-
Wvoid *Wmemchr(const Wvoid *s, Wint c, size_t n)
{
register const Wuchar *r = (const Wuchar *) s;
diff --git a/libc/string/memcpy.c b/libc/string/memcpy.c
index dc2986778..aa8d4ee38 100644
--- a/libc/string/memcpy.c
+++ b/libc/string/memcpy.c
@@ -13,8 +13,6 @@
# define Wmemcpy memcpy
#endif
-libc_hidden_proto(Wmemcpy)
-
Wvoid *Wmemcpy(Wvoid * __restrict s1, const Wvoid * __restrict s2, size_t n)
{
register Wchar *r1 = s1;
diff --git a/libc/string/mempcpy.c b/libc/string/mempcpy.c
index 91896434b..e7605146a 100644
--- a/libc/string/mempcpy.c
+++ b/libc/string/mempcpy.c
@@ -15,8 +15,6 @@
# define Wmempcpy mempcpy
#endif
-libc_hidden_proto(Wmempcpy)
-
Wvoid *Wmempcpy(Wvoid * __restrict s1, const Wvoid * __restrict s2, size_t n)
{
register Wchar *r1 = s1;
diff --git a/libc/string/strcasecmp.c b/libc/string/strcasecmp.c
index 5f2dc8e04..94c8ff492 100644
--- a/libc/string/strcasecmp.c
+++ b/libc/string/strcasecmp.c
@@ -12,28 +12,28 @@
#ifdef WANT_WIDE
# define strcasecmp wcscasecmp
# define strcasecmp_l wcscasecmp_l
-libc_hidden_proto(wcscasecmp)
+/* libc_hidden_proto(wcscasecmp) */
# if defined(__USE_GNU) && defined(__UCLIBC_HAS_XLOCALE__)
-libc_hidden_proto(wcscasecmp_l)
+/* libc_hidden_proto(wcscasecmp_l) */
# endif
# ifdef __UCLIBC_DO_XLOCALE
-libc_hidden_proto(towlower_l)
+/* libc_hidden_proto(towlower_l) */
# define TOLOWER(C) towlower_l((C), locale_arg)
# else
-libc_hidden_proto(towlower)
+/* libc_hidden_proto(towlower) */
# define TOLOWER(C) towlower((C))
# endif
#else
/* Experimentally off - libc_hidden_proto(strcasecmp) */
/* Experimentally off - libc_hidden_proto(strcasecmp_l) */
# ifdef __UCLIBC_DO_XLOCALE
-libc_hidden_proto(tolower_l)
+/* libc_hidden_proto(tolower_l) */
# define TOLOWER(C) tolower_l((C), locale_arg)
# else
#if !defined __UCLIBC_HAS_XLOCALE__ && defined __UCLIBC_HAS_CTYPE_TABLES__
/* libc_hidden_proto(__ctype_tolower) */
#endif
-libc_hidden_proto(tolower)
+/* libc_hidden_proto(tolower) */
# define TOLOWER(C) tolower((C))
# endif
#endif
diff --git a/libc/string/strcasestr.c b/libc/string/strcasestr.c
index 143392d3a..4804494cc 100644
--- a/libc/string/strcasestr.c
+++ b/libc/string/strcasestr.c
@@ -13,7 +13,7 @@
#elif defined __UCLIBC_HAS_CTYPE_TABLES__
/* libc_hidden_proto(__ctype_tolower) */
#endif
-libc_hidden_proto(tolower)
+/* libc_hidden_proto(tolower) */
char *strcasestr(const char *s1, const char *s2)
{
diff --git a/libc/string/strcat.c b/libc/string/strcat.c
index 40a9be111..63619bcc8 100644
--- a/libc/string/strcat.c
+++ b/libc/string/strcat.c
@@ -13,8 +13,6 @@
# define Wstrcat strcat
#endif
-libc_hidden_proto(Wstrcat)
-
Wchar *Wstrcat(Wchar * __restrict s1, register const Wchar * __restrict s2)
{
register Wchar *s = s1;
diff --git a/libc/string/strchr.c b/libc/string/strchr.c
index 329545e9f..462b7b1f1 100644
--- a/libc/string/strchr.c
+++ b/libc/string/strchr.c
@@ -13,8 +13,6 @@
# define Wstrchr strchr
#endif
-libc_hidden_proto(Wstrchr)
-
Wchar *Wstrchr(register const Wchar *s, Wint c)
{
do {
diff --git a/libc/string/strchrnul.c b/libc/string/strchrnul.c
index 6fe7f6c3d..d2d7df307 100644
--- a/libc/string/strchrnul.c
+++ b/libc/string/strchrnul.c
@@ -15,8 +15,6 @@
# define Wstrchrnul strchrnul
#endif
-libc_hidden_proto(Wstrchrnul)
-
Wchar *Wstrchrnul(register const Wchar *s, Wint c)
{
--s;
diff --git a/libc/string/strcmp.c b/libc/string/strcmp.c
index 5477adf3a..abae61812 100644
--- a/libc/string/strcmp.c
+++ b/libc/string/strcmp.c
@@ -15,8 +15,6 @@
# define Wstrcoll strcoll
#endif
-libc_hidden_proto(Wstrcmp)
-
int Wstrcmp(register const Wchar *s1, register const Wchar *s2)
{
#ifdef WANT_WIDE
@@ -40,7 +38,6 @@ int Wstrcmp(register const Wchar *s1, register const Wchar *s2)
libc_hidden_def(Wstrcmp)
#ifndef __UCLIBC_HAS_LOCALE__
-libc_hidden_proto(Wstrcoll)
strong_alias(Wstrcmp,Wstrcoll)
libc_hidden_def(Wstrcoll)
#endif
diff --git a/libc/string/strcpy.c b/libc/string/strcpy.c
index cda4094ac..568efbf60 100644
--- a/libc/string/strcpy.c
+++ b/libc/string/strcpy.c
@@ -13,8 +13,6 @@
# define Wstrcpy strcpy
#endif
-libc_hidden_proto(Wstrcpy)
-
Wchar *Wstrcpy(Wchar * __restrict s1, const Wchar * __restrict s2)
{
register Wchar *s = s1;
@@ -29,4 +27,9 @@ Wchar *Wstrcpy(Wchar * __restrict s1, const Wchar * __restrict s2)
return s1;
}
-libc_hidden_def(Wstrcpy)
+
+#ifdef WANT_WIDE
+/* wcscpy does not need libc_hidden_def */
+#else
+libc_hidden_def(strcpy)
+#endif
diff --git a/libc/string/strdup.c b/libc/string/strdup.c
index 61fc186c8..9eb28630e 100644
--- a/libc/string/strdup.c
+++ b/libc/string/strdup.c
@@ -9,7 +9,7 @@
#include <stdlib.h>
#ifdef WANT_WIDE
-libc_hidden_proto(wcslen)
+/* libc_hidden_proto(wcslen) */
# define Wstrdup wcsdup
# define Wstrlen wcslen
#else
diff --git a/libc/string/strerror.c b/libc/string/strerror.c
index 355c7bdda..a52c407f8 100644
--- a/libc/string/strerror.c
+++ b/libc/string/strerror.c
@@ -10,7 +10,7 @@
#include "_syserrmsg.h"
/* Experimentally off - libc_hidden_proto(strerror) */
-libc_hidden_proto(__xpg_strerror_r)
+/* libc_hidden_proto(__xpg_strerror_r) */
char *strerror(int errnum)
{
diff --git a/libc/string/strlcpy.c b/libc/string/strlcpy.c
index 4bdf0daa6..0ccfc0e8a 100644
--- a/libc/string/strlcpy.c
+++ b/libc/string/strlcpy.c
@@ -9,14 +9,10 @@
#ifdef WANT_WIDE
# define Wstrlcpy __wcslcpy
-# define Wstrxfrm wcsxfrm
#else
-/* Experimentally off - libc_hidden_proto(strlcpy) */
# define Wstrlcpy strlcpy
-# define Wstrxfrm strxfrm
#endif
-
/* OpenBSD function:
* Copy at most n-1 chars from src to dst and nul-terminate dst.
* Returns strlen(src), so truncation occurred if the return value is >= n. */
@@ -49,16 +45,19 @@ size_t Wstrlcpy(register Wchar *__restrict dst,
return src - src0;
}
-#ifndef WANT_WIDE
-libc_hidden_def(strlcpy)
+#ifdef WANT_WIDE
+
#ifndef __UCLIBC_HAS_LOCALE__
-/* Experimentally off - libc_hidden_proto(strxfrm) */
-strong_alias(strlcpy,strxfrm)
-libc_hidden_def(strxfrm)
+strong_alias(__wcslcpy,wcsxfrm)
+libc_hidden_def(wcsxfrm)
#endif
+
#else
+
+libc_hidden_def(strlcpy)
#ifndef __UCLIBC_HAS_LOCALE__
-strong_alias(__wcslcpy,wcsxfrm)
-libc_hidden_def(wcsxfrm)
+strong_alias(strlcpy,strxfrm)
+libc_hidden_def(strxfrm)
#endif
+
#endif
diff --git a/libc/string/strlen.c b/libc/string/strlen.c
index 2edb6e4e8..021a8cabc 100644
--- a/libc/string/strlen.c
+++ b/libc/string/strlen.c
@@ -13,8 +13,6 @@
# define Wstrlen strlen
#endif
-libc_hidden_proto(Wstrlen)
-
size_t Wstrlen(const Wchar *s)
{
register const Wchar *p;
diff --git a/libc/string/strncasecmp.c b/libc/string/strncasecmp.c
index 83efd85a7..a9e7245a8 100644
--- a/libc/string/strncasecmp.c
+++ b/libc/string/strncasecmp.c
@@ -12,28 +12,28 @@
#ifdef WANT_WIDE
# define strncasecmp wcsncasecmp
# define strncasecmp_l wcsncasecmp_l
-libc_hidden_proto(wcsncasecmp)
+/* libc_hidden_proto(wcsncasecmp) */
# if defined(__USE_GNU) && defined(__UCLIBC_HAS_XLOCALE__)
-libc_hidden_proto(wcsncasecmp_l)
+/* libc_hidden_proto(wcsncasecmp_l) */
# endif
# ifdef __UCLIBC_DO_XLOCALE
-libc_hidden_proto(towlower_l)
+/* libc_hidden_proto(towlower_l) */
# define TOLOWER(C) towlower_l((C), locale_arg)
# else
-libc_hidden_proto(towlower)
+/* libc_hidden_proto(towlower) */
# define TOLOWER(C) towlower((C))
# endif
#else
/* Experimentally off - libc_hidden_proto(strncasecmp) */
/* Experimentally off - libc_hidden_proto(strncasecmp_l) */
# ifdef __UCLIBC_DO_XLOCALE
-libc_hidden_proto(tolower_l)
+/* libc_hidden_proto(tolower_l) */
# define TOLOWER(C) tolower_l((C), locale_arg)
# else
#if !defined __UCLIBC_HAS_XLOCALE__ && defined __UCLIBC_HAS_CTYPE_TABLES__
/* libc_hidden_proto(__ctype_tolower) */
#endif
-libc_hidden_proto(tolower)
+/* libc_hidden_proto(tolower) */
# define TOLOWER(C) tolower((C))
# endif
#endif
diff --git a/libc/string/strnlen.c b/libc/string/strnlen.c
index 8fbc25c11..98267e51b 100644
--- a/libc/string/strnlen.c
+++ b/libc/string/strnlen.c
@@ -15,8 +15,6 @@
# define Wstrnlen strnlen
#endif
-libc_hidden_proto(Wstrnlen)
-
size_t Wstrnlen(const Wchar *s, size_t max)
{
register const Wchar *p = s;
diff --git a/libc/string/strpbrk.c b/libc/string/strpbrk.c
index abeb84380..ddfc75172 100644
--- a/libc/string/strpbrk.c
+++ b/libc/string/strpbrk.c
@@ -13,8 +13,6 @@
# define Wstrpbrk strpbrk
#endif
-libc_hidden_proto(Wstrpbrk)
-
Wchar *Wstrpbrk(const Wchar *s1, const Wchar *s2)
{
register const Wchar *s;
diff --git a/libc/string/strspn.c b/libc/string/strspn.c
index ca83ef900..942b6f308 100644
--- a/libc/string/strspn.c
+++ b/libc/string/strspn.c
@@ -13,8 +13,6 @@
# define Wstrspn strspn
#endif
-libc_hidden_proto(Wstrspn)
-
size_t Wstrspn(const Wchar *s1, const Wchar *s2)
{
register const Wchar *s = s1;
diff --git a/libc/string/strtok_r.c b/libc/string/strtok_r.c
index 2ad7746b1..c81231997 100644
--- a/libc/string/strtok_r.c
+++ b/libc/string/strtok_r.c
@@ -8,8 +8,8 @@
#include "_string.h"
#ifdef WANT_WIDE
-libc_hidden_proto(wcsspn)
-libc_hidden_proto(wcspbrk)
+/* libc_hidden_proto(wcsspn) */
+/* libc_hidden_proto(wcspbrk) */
# define Wstrtok_r wcstok
# define Wstrspn wcsspn
# define Wstrpbrk wcspbrk