summaryrefslogtreecommitdiff
path: root/libc/string
diff options
context:
space:
mode:
Diffstat (limited to 'libc/string')
-rw-r--r--libc/string/Makefile3
-rw-r--r--libc/string/wstring.c11
2 files changed, 11 insertions, 3 deletions
diff --git a/libc/string/Makefile b/libc/string/Makefile
index 6c29bb9ec..811ec0b23 100644
--- a/libc/string/Makefile
+++ b/libc/string/Makefile
@@ -38,7 +38,8 @@ MOBJW= basename.o bcopy.o bzero.o dirname.o ffs.o memccpy.o memchr.o memcmp.o \
MOBJW2= wcscasecmp.o wcscat.o wcschrnul.o wcschr.o wcscmp.o wcscpy.o wcscspn.o \
wcsdup.o wcslen.o wcsncasecmp.o wcsncat.o wcsncmp.o wcsncpy.o \
wcsnlen.o wcspbrk.o wcsrchr.o wcsspn.o wcsstr.o wcstok.o wmemchr.o \
- wmemcmp.o wmemcpy.o wmemmove.o wmempcpy.o wmemset.o wcpcpy.o wcpncpy.o
+ wmemcmp.o wmemcpy.o wmemmove.o wmempcpy.o wmemset.o wcpcpy.o wcpncpy.o \
+ wcschrnul.o
# wcscoll wcsxfrm
diff --git a/libc/string/wstring.c b/libc/string/wstring.c
index 8a8206364..ab6bd4169 100644
--- a/libc/string/wstring.c
+++ b/libc/string/wstring.c
@@ -366,7 +366,7 @@ const char *const sys_errlist[] = {
#endif
#if EWOULDBLOCK != EAGAIN
-#warning EWOULDBLOCK does not equal EAGAIN
+#error EWOULDBLOCK does not equal EAGAIN
#endif
/* For now, ignore the other arch-specific errors. glibc only maps EPROCLIM. */
@@ -628,7 +628,9 @@ int Wmemcmp(const Wvoid *s1, const Wvoid *s2, size_t n)
#ifdef L_strcmp
#ifndef L_wcscmp
+#ifdef __UCLIBC_MJN3_ONLY__
#warning implement strcoll and remove weak alias (or enable for C locale only)
+#endif
weak_alias(strcmp,strcoll);
#endif
@@ -1750,14 +1752,19 @@ char *strsep(char ** __restrict s1, const char * __restrict s2)
/**********************************************************************/
#ifdef L_wcschrnul
#define L_strchrnul
+#define __Wstrchrnul __wcschrnul
#define Wstrchrnul wcschrnul
#else
+#define __Wstrchrnul __strchrnul
#define Wstrchrnul strchrnul
#endif
#ifdef L_strchrnul
-Wchar *Wstrchrnul(register const Wchar *s, Wint c)
+extern Wchar *__Wstrchrnul(register const Wchar *s, Wint c);
+weak_alias(__Wstrchrnul, Wstrchrnul);
+
+Wchar *__Wstrchrnul(register const Wchar *s, Wint c)
{
--s;
while (*++s && (*s != ((Wchar)c)));