diff options
Diffstat (limited to 'libc')
62 files changed, 126 insertions, 120 deletions
diff --git a/libc/string/__xpg_strerror_r.c b/libc/string/__xpg_strerror_r.c index c5096a6f7..001115261 100644 --- a/libc/string/__xpg_strerror_r.c +++ b/libc/string/__xpg_strerror_r.c @@ -5,14 +5,19 @@ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ +/* Make sure we get proper strerror_r() prototype */ +#define strerror_r _hidestrerror_r + #include <features.h> #include <errno.h> #include <string.h> #include "_syserrmsg.h" +#undef strerror_r + libc_hidden_proto(__xpg_strerror_r) -libc_hidden_proto(memcpy) -libc_hidden_proto(strlen) +/* Experimentally off - libc_hidden_proto(memcpy) */ +/* Experimentally off - libc_hidden_proto(strlen) */ #ifdef __UCLIBC_HAS_ERRNO_MESSAGES__ @@ -271,3 +276,4 @@ int __xpg_strerror_r(int errnum, char *strerrbuf, size_t buflen) #endif /* __UCLIBC_HAS_ERRNO_MESSAGES__ */ libc_hidden_def(__xpg_strerror_r) +weak_alias(__xpg_strerror_r, strerror_r) diff --git a/libc/string/_collate.c b/libc/string/_collate.c index 3009e4ebf..64b5d9608 100644 --- a/libc/string/_collate.c +++ b/libc/string/_collate.c @@ -19,10 +19,10 @@ #include <errno.h> #include <assert.h> -libc_hidden_proto(memset) -libc_hidden_proto(memcpy) -libc_hidden_proto(strlcpy) -libc_hidden_proto(strcmp) +/* Experimentally off - libc_hidden_proto(memset) */ +/* Experimentally off - libc_hidden_proto(memcpy) */ +/* Experimentally off - libc_hidden_proto(strlcpy) */ +/* Experimentally off - libc_hidden_proto(strcmp) */ #ifdef WANT_WIDE libc_hidden_proto(wcsxfrm) libc_hidden_proto(wcscmp) diff --git a/libc/string/basename.c b/libc/string/basename.c index 739eaec56..a076c20e9 100644 --- a/libc/string/basename.c +++ b/libc/string/basename.c @@ -8,7 +8,7 @@ #include "_string.h" #ifdef __USE_GNU -libc_hidden_proto(basename) +/* Experimentally off - libc_hidden_proto(basename) */ char *basename(const char *path) { diff --git a/libc/string/bcopy.c b/libc/string/bcopy.c index bd233cb9c..3aa7eab1e 100644 --- a/libc/string/bcopy.c +++ b/libc/string/bcopy.c @@ -9,7 +9,7 @@ #ifdef __UCLIBC_SUSV3_LEGACY__ -libc_hidden_proto(memmove) +/* Experimentally off - libc_hidden_proto(memmove) */ void bcopy(const void *s2, void *s1, size_t n) { diff --git a/libc/string/bzero.c b/libc/string/bzero.c index 519695cab..7498f795f 100644 --- a/libc/string/bzero.c +++ b/libc/string/bzero.c @@ -9,7 +9,7 @@ #ifdef __UCLIBC_SUSV3_LEGACY__ -libc_hidden_proto(memset) +/* Experimentally off - libc_hidden_proto(memset) */ void bzero(void *s, size_t n) { diff --git a/libc/string/ffs.c b/libc/string/ffs.c index 9a68dc302..f7d94ebf0 100644 --- a/libc/string/ffs.c +++ b/libc/string/ffs.c @@ -8,9 +8,8 @@ /* ffsl,ffsll */ #include "_string.h" -#include <strings.h> -libc_hidden_proto(ffs) +/* Experimentally off - libc_hidden_proto(ffs) */ int ffs(int i) { diff --git a/libc/string/generic/memchr.c b/libc/string/generic/memchr.c index 4bda5d758..3c7c997bc 100644 --- a/libc/string/generic/memchr.c +++ b/libc/string/generic/memchr.c @@ -25,7 +25,7 @@ #include <stdlib.h> #include <limits.h> -libc_hidden_proto(memchr) +/* Experimentally off - libc_hidden_proto(memchr) */ libc_hidden_proto(abort) #include "memcopy.h" @@ -174,4 +174,4 @@ void *memchr (const void * s, int c_in, size_t n) return 0; } -libc_hidden_def(memchr) +libc_hidden_weak(memchr) diff --git a/libc/string/generic/memcmp.c b/libc/string/generic/memcmp.c index b754a5195..fc63a2eae 100644 --- a/libc/string/generic/memcmp.c +++ b/libc/string/generic/memcmp.c @@ -21,7 +21,7 @@ #include <string.h> #include "memcopy.h" -libc_hidden_proto(memcmp) +/* Experimentally off - libc_hidden_proto(memcmp) */ #include <endian.h> @@ -59,8 +59,7 @@ static int memcmp_bytes __P((op_t, op_t)); __inline # endif static int -memcmp_bytes (a, b) - op_t a, b; +memcmp_bytes (op_t a, op_t b) { long int srcp1 = (long int) &a; long int srcp2 = (long int) &b; @@ -84,10 +83,7 @@ static int memcmp_common_alignment __P((long, long, size_t)); objects (not LEN bytes!). Both SRCP1 and SRCP2 should be aligned for memory operations on `op_t's. */ static int -memcmp_common_alignment (srcp1, srcp2, len) - long int srcp1; - long int srcp2; - size_t len; +memcmp_common_alignment (long int srcp1, long int srcp2, size_t len) { op_t a0, a1; op_t b0, b1; @@ -171,10 +167,7 @@ static int memcmp_not_common_alignment __P((long, long, size_t)); `op_t' objects (not LEN bytes!). SRCP2 should be aligned for memory operations on `op_t', but SRCP1 *should be unaligned*. */ static int -memcmp_not_common_alignment (srcp1, srcp2, len) - long int srcp1; - long int srcp2; - size_t len; +memcmp_not_common_alignment (long int srcp1, long int srcp2, size_t len) { op_t a0, a1, a2, a3; op_t b0, b1, b2, b3; @@ -330,7 +323,7 @@ memcmp (const __ptr_t s1, const __ptr_t s2, size_t len) return 0; } -libc_hidden_def(memcmp) +libc_hidden_weak(memcmp) #ifdef __UCLIBC_SUSV3_LEGACY__ strong_alias(memcmp,bcmp) #endif diff --git a/libc/string/generic/memcpy.c b/libc/string/generic/memcpy.c index c36c9da42..4284f2fe5 100644 --- a/libc/string/generic/memcpy.c +++ b/libc/string/generic/memcpy.c @@ -23,7 +23,7 @@ #include "memcopy.h" #include "pagecopy.h" -libc_hidden_proto(memcpy) +/* Experimentally off - libc_hidden_proto(memcpy) */ void *memcpy (void *dstpp, const void *srcpp, size_t len) { @@ -58,4 +58,4 @@ void *memcpy (void *dstpp, const void *srcpp, size_t len) return dstpp; } -libc_hidden_def(memcpy) +libc_hidden_weak(memcpy) diff --git a/libc/string/generic/memmem.c b/libc/string/generic/memmem.c index 5d4e6f151..c75bb2426 100644 --- a/libc/string/generic/memmem.c +++ b/libc/string/generic/memmem.c @@ -20,8 +20,8 @@ #include <stddef.h> #ifdef __USE_GNU -libc_hidden_proto(memmem) -libc_hidden_proto(memcmp) +/* Experimentally off - libc_hidden_proto(memmem) */ +/* Experimentally off - libc_hidden_proto(memcmp) */ /* Return the first occurrence of NEEDLE in HAYSTACK. */ void *memmem (const void *haystack, size_t haystack_len, diff --git a/libc/string/generic/mempcpy.c b/libc/string/generic/mempcpy.c index 46d19024b..8d7356486 100644 --- a/libc/string/generic/mempcpy.c +++ b/libc/string/generic/mempcpy.c @@ -8,13 +8,13 @@ #include <string.h> #ifdef __USE_GNU -libc_hidden_proto(mempcpy) -libc_hidden_proto(memcpy) +/* Experimentally off - libc_hidden_proto(mempcpy) */ +/* Experimentally off - libc_hidden_proto(memcpy) */ void *mempcpy (void *dstpp, const void *srcpp, size_t len) { memcpy(dstpp, srcpp, len); return (void *)(((char *)dstpp) + len); } -libc_hidden_def(mempcpy) +libc_hidden_weak(mempcpy) #endif diff --git a/libc/string/generic/memrchr.c b/libc/string/generic/memrchr.c index 43439d5ce..9ab805cf7 100644 --- a/libc/string/generic/memrchr.c +++ b/libc/string/generic/memrchr.c @@ -27,7 +27,7 @@ #include <limits.h> #ifdef __USE_GNU -libc_hidden_proto(memrchr) +/* Experimentally off - libc_hidden_proto(memrchr) */ libc_hidden_proto(abort) #include "memcopy.h" diff --git a/libc/string/generic/memset.c b/libc/string/generic/memset.c index 1df1a450f..62cc36fe3 100644 --- a/libc/string/generic/memset.c +++ b/libc/string/generic/memset.c @@ -19,7 +19,7 @@ #include <string.h> #include "memcopy.h" -libc_hidden_proto(memset) +/* Experimentally off - libc_hidden_proto(memset) */ void *memset (void *dstpp, int c, size_t len) { long int dstp = (long int) dstpp; @@ -83,4 +83,4 @@ void *memset (void *dstpp, int c, size_t len) return dstpp; } -libc_hidden_def(memset) +libc_hidden_weak(memset) diff --git a/libc/string/generic/rawmemchr.c b/libc/string/generic/rawmemchr.c index 6bf245265..f8b97a61d 100644 --- a/libc/string/generic/rawmemchr.c +++ b/libc/string/generic/rawmemchr.c @@ -26,7 +26,7 @@ #include <limits.h> #ifdef __USE_GNU -libc_hidden_proto(rawmemchr) +/* Experimentally off - libc_hidden_proto(rawmemchr) */ libc_hidden_proto(abort) #include "memcopy.h" diff --git a/libc/string/generic/strcat.c b/libc/string/generic/strcat.c index 53c4d0d9e..e00494038 100644 --- a/libc/string/generic/strcat.c +++ b/libc/string/generic/strcat.c @@ -19,7 +19,7 @@ #include <string.h> #include "memcopy.h" -libc_hidden_proto(strcat) +/* Experimentally off - libc_hidden_proto(strcat) */ /* Append SRC on the end of DEST. */ char *strcat (char *dest, const char *src) { diff --git a/libc/string/generic/strchr.c b/libc/string/generic/strchr.c index 8d401ec8c..66aed1e25 100644 --- a/libc/string/generic/strchr.c +++ b/libc/string/generic/strchr.c @@ -24,7 +24,7 @@ #include <string.h> #include <stdlib.h> -libc_hidden_proto(strchr) +/* Experimentally off - libc_hidden_proto(strchr) */ libc_hidden_proto(abort) #include "memcopy.h" @@ -181,7 +181,7 @@ char *strchr (const char *s, int c_in) return NULL; } -libc_hidden_def(strchr) +libc_hidden_weak(strchr) #ifdef __UCLIBC_SUSV3_LEGACY__ -strong_alias(strchr,index) +weak_alias(strchr,index) #endif diff --git a/libc/string/generic/strchrnul.c b/libc/string/generic/strchrnul.c index 17e32ab44..72cab2891 100644 --- a/libc/string/generic/strchrnul.c +++ b/libc/string/generic/strchrnul.c @@ -25,7 +25,7 @@ #include <stdlib.h> #ifdef __USE_GNU -libc_hidden_proto(strchrnul) +/* Experimentally off - libc_hidden_proto(strchrnul) */ libc_hidden_proto(abort) #include "memcopy.h" diff --git a/libc/string/generic/strcmp.c b/libc/string/generic/strcmp.c index acfefb6dc..50acd3548 100644 --- a/libc/string/generic/strcmp.c +++ b/libc/string/generic/strcmp.c @@ -20,7 +20,7 @@ #include "memcopy.h" -libc_hidden_proto(strcmp) +/* Experimentally off - 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. */ @@ -41,10 +41,10 @@ int strcmp (const char *p1, const char *p2) return c1 - c2; } -libc_hidden_def(strcmp) +libc_hidden_weak(strcmp) #ifndef __UCLIBC_HAS_LOCALE__ -libc_hidden_proto(strcoll) +/* Experimentally off - libc_hidden_proto(strcoll) */ strong_alias(strcmp,strcoll) libc_hidden_def(strcoll) #endif diff --git a/libc/string/generic/strcpy.c b/libc/string/generic/strcpy.c index 7e558ead1..99e077139 100644 --- a/libc/string/generic/strcpy.c +++ b/libc/string/generic/strcpy.c @@ -22,7 +22,7 @@ #include "memcopy.h" #include "bp-checks.h" -libc_hidden_proto(strcpy) +/* Experimentally off - libc_hidden_proto(strcpy) */ /* Copy SRC to DEST. */ char *strcpy (char *dest, const char *src) { diff --git a/libc/string/generic/strcspn.c b/libc/string/generic/strcspn.c index 1b5e465ea..b65b3b995 100644 --- a/libc/string/generic/strcspn.c +++ b/libc/string/generic/strcspn.c @@ -18,8 +18,8 @@ #include <string.h> -libc_hidden_proto(strcspn) -libc_hidden_proto(strchr) +/* Experimentally off - libc_hidden_proto(strcspn) */ +/* Experimentally off - libc_hidden_proto(strchr) */ /* Return the length of the maximum initial segment of S which contains no characters from REJECT. */ diff --git a/libc/string/generic/strlen.c b/libc/string/generic/strlen.c index 3528829af..764dae18d 100644 --- a/libc/string/generic/strlen.c +++ b/libc/string/generic/strlen.c @@ -22,7 +22,7 @@ #include <string.h> #include <stdlib.h> -libc_hidden_proto(strlen) +/* Experimentally off - libc_hidden_proto(strlen) */ libc_hidden_proto(abort) /* Return the length of the null-terminated string STR. Scan for @@ -149,4 +149,4 @@ size_t strlen (const char *str) } } } -libc_hidden_def(strlen) +libc_hidden_weak(strlen) diff --git a/libc/string/generic/strncat.c b/libc/string/generic/strncat.c index 9e0dfcd78..8e3423e49 100644 --- a/libc/string/generic/strncat.c +++ b/libc/string/generic/strncat.c @@ -20,7 +20,7 @@ #include "memcopy.h" -libc_hidden_proto(strncat) +/* Experimentally off - libc_hidden_proto(strncat) */ char *strncat (char *s1, const char *s2, size_t n) { reg_char c; diff --git a/libc/string/generic/strncmp.c b/libc/string/generic/strncmp.c index 12e0e4d17..c49f36d8b 100644 --- a/libc/string/generic/strncmp.c +++ b/libc/string/generic/strncmp.c @@ -19,7 +19,7 @@ #include <string.h> #include "memcopy.h" -libc_hidden_proto(strncmp) +/* Experimentally off - 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 diff --git a/libc/string/generic/strncpy.c b/libc/string/generic/strncpy.c index 4b0b0894e..d2d693f2b 100644 --- a/libc/string/generic/strncpy.c +++ b/libc/string/generic/strncpy.c @@ -19,7 +19,7 @@ #include <string.h> #include "memcopy.h" -libc_hidden_proto(strncpy) +/* Experimentally off - libc_hidden_proto(strncpy) */ char *strncpy (char *s1, const char *s2, size_t n) { reg_char c; diff --git a/libc/string/generic/strnlen.c b/libc/string/generic/strnlen.c index 3156e469a..d9ba76129 100644 --- a/libc/string/generic/strnlen.c +++ b/libc/string/generic/strnlen.c @@ -25,7 +25,7 @@ #include <stdlib.h> #ifdef __USE_GNU -libc_hidden_proto(strnlen) +/* Experimentally off - libc_hidden_proto(strnlen) */ libc_hidden_proto(abort) /* Find the length of S, but scan at most MAXLEN characters. If no diff --git a/libc/string/generic/strrchr.c b/libc/string/generic/strrchr.c index 97192da95..c85707241 100644 --- a/libc/string/generic/strrchr.c +++ b/libc/string/generic/strrchr.c @@ -18,8 +18,8 @@ #include <string.h> -libc_hidden_proto(strrchr) -libc_hidden_proto(strchr) +/* Experimentally off - libc_hidden_proto(strrchr) */ +/* Experimentally off - libc_hidden_proto(strchr) */ /* Find the last occurrence of C in S. */ char *strrchr (const char *s, int c) @@ -42,7 +42,7 @@ char *strrchr (const char *s, int c) return (char *) found; } -libc_hidden_def(strrchr) +libc_hidden_weak(strrchr) #ifdef __UCLIBC_SUSV3_LEGACY__ -strong_alias(strrchr,rindex) +weak_alias(strrchr,rindex) #endif diff --git a/libc/string/generic/strsep.c b/libc/string/generic/strsep.c index 5cb1779d2..e02e57068 100644 --- a/libc/string/generic/strsep.c +++ b/libc/string/generic/strsep.c @@ -20,10 +20,10 @@ #ifdef __USE_BSD -libc_hidden_proto(strchr) -libc_hidden_proto(strpbrk) +/* Experimentally off - libc_hidden_proto(strchr) */ +/* Experimentally off - libc_hidden_proto(strpbrk) */ -libc_hidden_proto(strsep) +/* Experimentally off - libc_hidden_proto(strsep) */ char *strsep (char **stringp, const char *delim) { char *begin, *end; diff --git a/libc/string/generic/strspn.c b/libc/string/generic/strspn.c index a194fdc7d..010567744 100644 --- a/libc/string/generic/strspn.c +++ b/libc/string/generic/strspn.c @@ -18,7 +18,7 @@ #include <string.h> -libc_hidden_proto(strspn) +/* Experimentally off - 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) diff --git a/libc/string/generic/strstr.c b/libc/string/generic/strstr.c index f151a820a..c12dceb33 100644 --- a/libc/string/generic/strstr.c +++ b/libc/string/generic/strstr.c @@ -28,7 +28,7 @@ #include <string.h> -libc_hidden_proto(strstr) +/* Experimentally off - libc_hidden_proto(strstr) */ typedef unsigned chartype; diff --git a/libc/string/generic/strtok_r.c b/libc/string/generic/strtok_r.c index bae394a80..d082d226e 100644 --- a/libc/string/generic/strtok_r.c +++ b/libc/string/generic/strtok_r.c @@ -19,15 +19,15 @@ #include <string.h> -libc_hidden_proto(strtok_r) -libc_hidden_proto(strspn) -libc_hidden_proto(strpbrk) +/* Experimentally off - libc_hidden_proto(strtok_r) */ +/* Experimentally off - libc_hidden_proto(strspn) */ +/* Experimentally off - libc_hidden_proto(strpbrk) */ #ifdef __USE_GNU # define __rawmemchr rawmemchr -libc_hidden_proto(rawmemchr) +/* Experimentally off - libc_hidden_proto(rawmemchr) */ #else # define __rawmemchr strchr -libc_hidden_proto(strchr) +/* Experimentally off - libc_hidden_proto(strchr) */ #endif /* Parse S into tokens separated by characters in DELIM. diff --git a/libc/string/memccpy.c b/libc/string/memccpy.c index fe5a76a4d..076bdac7d 100644 --- a/libc/string/memccpy.c +++ b/libc/string/memccpy.c @@ -18,3 +18,4 @@ void *memccpy(void * __restrict s1, const void * __restrict s2, int c, size_t n) return (n == (size_t) -1) ? NULL : r1; } +libc_hidden_def(memccpy) diff --git a/libc/string/memcmp.c b/libc/string/memcmp.c index 377a8d692..762fc23c1 100644 --- a/libc/string/memcmp.c +++ b/libc/string/memcmp.c @@ -10,7 +10,7 @@ #ifdef WANT_WIDE # define Wmemcmp wmemcmp #else -libc_hidden_proto(memcmp) +/* Experimentally off - libc_hidden_proto(memcmp) */ # define Wmemcmp memcmp #endif diff --git a/libc/string/memmem.c b/libc/string/memmem.c index fd60f1e7b..9dcd4c4c0 100644 --- a/libc/string/memmem.c +++ b/libc/string/memmem.c @@ -8,7 +8,7 @@ #include "_string.h" #ifdef __USE_GNU -libc_hidden_proto(memmem) +/* Experimentally off - libc_hidden_proto(memmem) */ void *memmem(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen) { diff --git a/libc/string/memmove.c b/libc/string/memmove.c index 3cdcca116..0bea9b497 100644 --- a/libc/string/memmove.c +++ b/libc/string/memmove.c @@ -10,7 +10,7 @@ #ifdef WANT_WIDE # define Wmemmove wmemmove #else -libc_hidden_proto(memmove) +/* Experimentally off - libc_hidden_proto(memmove) */ # define Wmemmove memmove #endif diff --git a/libc/string/mempcpy.c b/libc/string/mempcpy.c index cf4af8d39..91896434b 100644 --- a/libc/string/mempcpy.c +++ b/libc/string/mempcpy.c @@ -36,5 +36,5 @@ Wvoid *Wmempcpy(Wvoid * __restrict s1, const Wvoid * __restrict s2, size_t n) return r1; } -libc_hidden_def(Wmempcpy) +libc_hidden_weak(Wmempcpy) #endif diff --git a/libc/string/memrchr.c b/libc/string/memrchr.c index 2959396b2..b2f9001cd 100644 --- a/libc/string/memrchr.c +++ b/libc/string/memrchr.c @@ -9,7 +9,7 @@ #ifdef __USE_GNU -libc_hidden_proto(memrchr) +/* Experimentally off - libc_hidden_proto(memrchr) */ void *memrchr(const void *s, int c, size_t n) { diff --git a/libc/string/memset.c b/libc/string/memset.c index 2f3fc271d..6dd20d668 100644 --- a/libc/string/memset.c +++ b/libc/string/memset.c @@ -10,7 +10,7 @@ #ifdef WANT_WIDE # define Wmemset wmemset #else -libc_hidden_proto(memset) +/* Experimentally off - libc_hidden_proto(memset) */ # define Wmemset memset #endif diff --git a/libc/string/mips/sysdep.h b/libc/string/mips/sysdep.h index 96f088c94..5dad8342e 100644 --- a/libc/string/mips/sysdep.h +++ b/libc/string/mips/sysdep.h @@ -29,7 +29,7 @@ .globl name; \ .align 2; \ .ent name,0; \ - name##: + name/* use a comment rather than ## to workaround bug in gcc-3.4.x */: #undef END #define END(function) \ diff --git a/libc/string/psignal.c b/libc/string/psignal.c index 467e3bc37..1ca8725db 100644 --- a/libc/string/psignal.c +++ b/libc/string/psignal.c @@ -11,7 +11,7 @@ #include <signal.h> libc_hidden_proto(fprintf) -libc_hidden_proto(strsignal) +/* Experimentally off - libc_hidden_proto(strsignal) */ /* TODO: make this threadsafe with a reentrant version of strsignal? */ diff --git a/libc/string/rawmemchr.c b/libc/string/rawmemchr.c index 1bbcb01b5..3cddefa10 100644 --- a/libc/string/rawmemchr.c +++ b/libc/string/rawmemchr.c @@ -8,7 +8,7 @@ #include "_string.h" #ifdef __USE_GNU -libc_hidden_proto(rawmemchr) +/* Experimentally off - libc_hidden_proto(rawmemchr) */ void *rawmemchr(const void *s, int c) { register const unsigned char *r = s; diff --git a/libc/string/stpcpy.c b/libc/string/stpcpy.c index f34b9f65a..8a487584e 100644 --- a/libc/string/stpcpy.c +++ b/libc/string/stpcpy.c @@ -10,7 +10,7 @@ #ifdef WANT_WIDE # define Wstpcpy wcpcpy #else -libc_hidden_proto(stpcpy) +/* Experimentally off - libc_hidden_proto(stpcpy) */ # define Wstpcpy stpcpy #endif diff --git a/libc/string/stpncpy.c b/libc/string/stpncpy.c index 2603d2bd0..dac8471fd 100644 --- a/libc/string/stpncpy.c +++ b/libc/string/stpncpy.c @@ -10,7 +10,7 @@ #ifdef WANT_WIDE # define Wstpncpy wcpncpy #else -libc_hidden_proto(stpncpy) +/* Experimentally off - libc_hidden_proto(stpncpy) */ # define Wstpncpy stpncpy #endif diff --git a/libc/string/strcasecmp.c b/libc/string/strcasecmp.c index 7fa521fb7..f9852236b 100644 --- a/libc/string/strcasecmp.c +++ b/libc/string/strcasecmp.c @@ -6,13 +6,16 @@ */ #include "_string.h" -#include <strings.h> #include <ctype.h> #include <locale.h> #ifdef WANT_WIDE # define strcasecmp wcscasecmp # define strcasecmp_l wcscasecmp_l +libc_hidden_proto(wcscasecmp) +# if defined(__USE_GNU) && defined(__UCLIBC_HAS_XLOCALE__) +libc_hidden_proto(wcscasecmp_l) +# endif # ifdef __UCLIBC_DO_XLOCALE libc_hidden_proto(towlower_l) # define TOLOWER(C) towlower_l((C), locale_arg) @@ -21,6 +24,8 @@ 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) # define TOLOWER(C) tolower_l((C), locale_arg) @@ -35,9 +40,6 @@ libc_hidden_proto(tolower) #if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) -libc_hidden_proto(strcasecmp_l) - -libc_hidden_proto(strcasecmp) int strcasecmp(register const Wchar *s1, register const Wchar *s2) { return strcasecmp_l(s1, s2, __UCLIBC_CURLOCALE); @@ -46,7 +48,7 @@ libc_hidden_def(strcasecmp) #else /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */ -libc_hidden_proto(__XL_NPP(strcasecmp)) +/* Experimentally off - libc_hidden_proto(__XL_NPP(strcasecmp)) */ int __XL_NPP(strcasecmp)(register const Wchar *s1, register const Wchar *s2 __LOCALE_PARAM ) { diff --git a/libc/string/strcasestr.c b/libc/string/strcasestr.c index afef59985..2671b4b98 100644 --- a/libc/string/strcasestr.c +++ b/libc/string/strcasestr.c @@ -10,7 +10,7 @@ #ifdef __UCLIBC_HAS_XLOCALE__ libc_hidden_proto(__ctype_tolower_loc) -#elif __UCLIBC_HAS_CTYPE_TABLES__ +#elif defined __UCLIBC_HAS_CTYPE_TABLES__ libc_hidden_proto(__ctype_tolower) #endif libc_hidden_proto(tolower) @@ -54,3 +54,4 @@ char *strcasestr(const char *s1, const char *s2) return (*p) ? NULL : (char *) s1; #endif } +libc_hidden_def(strcasestr) diff --git a/libc/string/strchr.c b/libc/string/strchr.c index 0ce552438..329545e9f 100644 --- a/libc/string/strchr.c +++ b/libc/string/strchr.c @@ -28,5 +28,5 @@ Wchar *Wstrchr(register const Wchar *s, Wint c) libc_hidden_def(Wstrchr) #if !defined WANT_WIDE && defined __UCLIBC_SUSV3_LEGACY__ -strong_alias(strchr,index) +weak_alias(strchr,index) #endif diff --git a/libc/string/strcspn.c b/libc/string/strcspn.c index 75d2e081b..1ec460a15 100644 --- a/libc/string/strcspn.c +++ b/libc/string/strcspn.c @@ -10,7 +10,7 @@ #ifdef WANT_WIDE # define Wstrcspn wcscspn #else -libc_hidden_proto(strcspn) +/* Experimentally off - libc_hidden_proto(strcspn) */ # define Wstrcspn strcspn #endif diff --git a/libc/string/strdup.c b/libc/string/strdup.c index d15345d0d..61fc186c8 100644 --- a/libc/string/strdup.c +++ b/libc/string/strdup.c @@ -13,12 +13,12 @@ libc_hidden_proto(wcslen) # define Wstrdup wcsdup # define Wstrlen wcslen #else -libc_hidden_proto(strdup) -libc_hidden_proto(strlen) +/* Experimentally off - libc_hidden_proto(strdup) */ +/* Experimentally off - libc_hidden_proto(strlen) */ # define Wstrdup strdup # define Wstrlen strlen #endif -libc_hidden_proto(memcpy) +/* Experimentally off - libc_hidden_proto(memcpy) */ Wchar *Wstrdup(register const Wchar *s1) { @@ -33,5 +33,5 @@ Wchar *Wstrdup(register const Wchar *s1) } #ifndef WANT_WIDE -libc_hidden_def(strdup) +libc_hidden_weak(strdup) #endif diff --git a/libc/string/strerror.c b/libc/string/strerror.c index 1b5cb3ff2..355c7bdda 100644 --- a/libc/string/strerror.c +++ b/libc/string/strerror.c @@ -9,7 +9,7 @@ #include <string.h> #include "_syserrmsg.h" -libc_hidden_proto(strerror) +/* Experimentally off - libc_hidden_proto(strerror) */ libc_hidden_proto(__xpg_strerror_r) char *strerror(int errnum) diff --git a/libc/string/strlcat.c b/libc/string/strlcat.c index 117b8e552..d55761d4c 100644 --- a/libc/string/strlcat.c +++ b/libc/string/strlcat.c @@ -44,3 +44,4 @@ size_t strlcat(register char *__restrict dst, return len; } +libc_hidden_def(strlcat) diff --git a/libc/string/strlcpy.c b/libc/string/strlcpy.c index e888b85b2..cdad4dc5d 100644 --- a/libc/string/strlcpy.c +++ b/libc/string/strlcpy.c @@ -11,7 +11,7 @@ # define Wstrlcpy __wcslcpy # define Wstrxfrm wcsxfrm #else -libc_hidden_proto(strlcpy) +/* Experimentally off - libc_hidden_proto(strlcpy) */ # define Wstrlcpy strlcpy # define Wstrxfrm strxfrm #endif @@ -52,7 +52,7 @@ size_t Wstrlcpy(register Wchar *__restrict dst, #ifndef WANT_WIDE libc_hidden_def(strlcpy) #ifndef __UCLIBC_HAS_LOCALE__ -libc_hidden_proto(strxfrm) +/* Experimentally off - libc_hidden_proto(strxfrm) */ strong_alias(strlcpy,strxfrm) libc_hidden_def(strxfrm) #endif diff --git a/libc/string/strlen.c b/libc/string/strlen.c index bcb096b97..2edb6e4e8 100644 --- a/libc/string/strlen.c +++ b/libc/string/strlen.c @@ -23,4 +23,4 @@ size_t Wstrlen(const Wchar *s) return p - s; } -libc_hidden_def(Wstrlen) +libc_hidden_weak(Wstrlen) diff --git a/libc/string/strncasecmp.c b/libc/string/strncasecmp.c index 9980dd704..ed052fa21 100644 --- a/libc/string/strncasecmp.c +++ b/libc/string/strncasecmp.c @@ -6,13 +6,16 @@ */ #include "_string.h" -#include <strings.h> #include <ctype.h> #include <locale.h> #ifdef WANT_WIDE # define strncasecmp wcsncasecmp # define strncasecmp_l wcsncasecmp_l +libc_hidden_proto(wcsncasecmp) +# if defined(__USE_GNU) && defined(__UCLIBC_HAS_XLOCALE__) +libc_hidden_proto(wcsncasecmp_l) +# endif # ifdef __UCLIBC_DO_XLOCALE libc_hidden_proto(towlower_l) # define TOLOWER(C) towlower_l((C), locale_arg) @@ -21,6 +24,8 @@ 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) # define TOLOWER(C) tolower_l((C), locale_arg) @@ -35,9 +40,6 @@ libc_hidden_proto(tolower) #if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) -libc_hidden_proto(strncasecmp_l) - -libc_hidden_proto(strncasecmp) int strncasecmp(register const Wchar *s1, register const Wchar *s2, size_t n) { return strncasecmp_l(s1, s2, n, __UCLIBC_CURLOCALE); @@ -46,7 +48,7 @@ libc_hidden_def(strncasecmp) #else /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */ -libc_hidden_proto(__XL_NPP(strncasecmp)) +/* Experimentally off - libc_hidden_proto(__XL_NPP(strncasecmp)) */ int __XL_NPP(strncasecmp)(register const Wchar *s1, register const Wchar *s2, size_t n __LOCALE_PARAM ) { diff --git a/libc/string/strncat.c b/libc/string/strncat.c index 61170c369..0180d1328 100644 --- a/libc/string/strncat.c +++ b/libc/string/strncat.c @@ -10,7 +10,7 @@ #ifdef WANT_WIDE # define Wstrncat wcsncat #else -libc_hidden_proto(strncat) +/* Experimentally off - libc_hidden_proto(strncat) */ # define Wstrncat strncat #endif @@ -21,7 +21,7 @@ Wchar *Wstrncat(Wchar * __restrict s1, register const Wchar * __restrict s2, while (*s++); --s; -#if __BCC__ +#ifdef __BCC__ while (n-- && ((*s = *s2++) != 0)) ++s; #else while (n && ((*s = *s2++) != 0)) { diff --git a/libc/string/strncmp.c b/libc/string/strncmp.c index 8cebaacac..59e4a2c22 100644 --- a/libc/string/strncmp.c +++ b/libc/string/strncmp.c @@ -10,7 +10,7 @@ #ifdef WANT_WIDE # define Wstrncmp wcsncmp #else -libc_hidden_proto(strncmp) +/* Experimentally off - libc_hidden_proto(strncmp) */ # define Wstrncmp strncmp #endif @@ -25,7 +25,7 @@ int Wstrncmp(register const Wchar *s1, register const Wchar *s2, size_t n) --n; } - return (n == 0) ? 0 : ((*((Wuchar *)s1) < *((Wuchar *)s2)) ? -1 : 1); + return (n == 0) ? 0 : (*((Wuchar *)s1) - *((Wuchar *)s2)); #else int r = 0; diff --git a/libc/string/strncpy.c b/libc/string/strncpy.c index 40da93dac..ea5e494c7 100644 --- a/libc/string/strncpy.c +++ b/libc/string/strncpy.c @@ -10,7 +10,7 @@ #ifdef WANT_WIDE # define Wstrncpy wcsncpy #else -libc_hidden_proto(strncpy) +/* Experimentally off - libc_hidden_proto(strncpy) */ # define Wstrncpy strncpy #endif diff --git a/libc/string/strndup.c b/libc/string/strndup.c index 89c58ccec..96a36d404 100644 --- a/libc/string/strndup.c +++ b/libc/string/strndup.c @@ -8,9 +8,9 @@ #include "_string.h" #include <stdlib.h> -libc_hidden_proto(strndup) -libc_hidden_proto(strnlen) -libc_hidden_proto(memcpy) +/* Experimentally off - libc_hidden_proto(strndup) */ +/* Experimentally off - libc_hidden_proto(strnlen) */ +/* Experimentally off - libc_hidden_proto(memcpy) */ char *strndup(register const char *s1, size_t n) { diff --git a/libc/string/strrchr.c b/libc/string/strrchr.c index 67cafb75a..253c4166d 100644 --- a/libc/string/strrchr.c +++ b/libc/string/strrchr.c @@ -10,7 +10,7 @@ #ifdef WANT_WIDE # define Wstrrchr wcsrchr #else -libc_hidden_proto(strrchr) +/* Experimentally off - libc_hidden_proto(strrchr) */ # define Wstrrchr strrchr #endif @@ -28,8 +28,8 @@ Wchar *Wstrrchr(register const Wchar *s, Wint c) return (Wchar *) p; /* silence the warning */ } #ifndef WANT_WIDE -libc_hidden_def(strrchr) +libc_hidden_weak(strrchr) # ifdef __UCLIBC_SUSV3_LEGACY__ -strong_alias(strrchr,rindex) +weak_alias(strrchr,rindex) # endif #endif diff --git a/libc/string/strsep.c b/libc/string/strsep.c index 2cc940def..373b00a71 100644 --- a/libc/string/strsep.c +++ b/libc/string/strsep.c @@ -9,10 +9,10 @@ #ifdef __USE_BSD -libc_hidden_proto(strpbrk) -libc_hidden_proto(strcspn) +/* Experimentally off - libc_hidden_proto(strpbrk) */ +/* Experimentally off - libc_hidden_proto(strcspn) */ -libc_hidden_proto(strsep) +/* Experimentally off - libc_hidden_proto(strsep) */ char *strsep(char ** __restrict s1, const char * __restrict s2) { register char *s = *s1; diff --git a/libc/string/strsignal.c b/libc/string/strsignal.c index f8b6a9e9f..ee083d649 100644 --- a/libc/string/strsignal.c +++ b/libc/string/strsignal.c @@ -18,8 +18,8 @@ #include <bits/uClibc_uintmaxtostr.h> #include <signal.h> -libc_hidden_proto(strsignal) -libc_hidden_proto(memcpy) +/* Experimentally off - libc_hidden_proto(strsignal) */ +/* Experimentally off - libc_hidden_proto(memcpy) */ #define _SYS_NSIG 32 diff --git a/libc/string/strstr.c b/libc/string/strstr.c index 685a2f83c..05712e62b 100644 --- a/libc/string/strstr.c +++ b/libc/string/strstr.c @@ -10,7 +10,7 @@ #ifdef WANT_WIDE # define Wstrstr wcsstr #else -libc_hidden_proto(strstr) +/* Experimentally off - libc_hidden_proto(strstr) */ # define Wstrstr strstr #endif diff --git a/libc/string/strtok.c b/libc/string/strtok.c index 127497c9d..159dd6b6a 100644 --- a/libc/string/strtok.c +++ b/libc/string/strtok.c @@ -15,10 +15,11 @@ # define Wstrtok_r strtok_r #endif -libc_hidden_proto(Wstrtok_r) +/* Experimentally off - libc_hidden_proto(Wstrtok_r) */ Wchar *Wstrtok(Wchar * __restrict s1, const Wchar * __restrict s2) { static Wchar *next_start; /* Initialized to 0 since in bss. */ return Wstrtok_r(s1, s2, &next_start); } +libc_hidden_def(Wstrtok) diff --git a/libc/string/strtok_r.c b/libc/string/strtok_r.c index bda56d71c..2ad7746b1 100644 --- a/libc/string/strtok_r.c +++ b/libc/string/strtok_r.c @@ -14,9 +14,9 @@ libc_hidden_proto(wcspbrk) # define Wstrspn wcsspn # define Wstrpbrk wcspbrk #else -libc_hidden_proto(strtok_r) -libc_hidden_proto(strspn) -libc_hidden_proto(strpbrk) +/* Experimentally off - libc_hidden_proto(strtok_r) */ +/* Experimentally off - libc_hidden_proto(strspn) */ +/* Experimentally off - libc_hidden_proto(strpbrk) */ # define Wstrtok_r strtok_r # define Wstrspn strspn # define Wstrpbrk strpbrk |