Browse Source

libc/string: need additional work to remove libc_hidden_proto's properly

Denis Vlasenko 15 years ago
parent
commit
d8ea341e64

+ 2 - 0
include/wchar.h

@@ -233,6 +233,7 @@ __BEGIN_NAMESPACE_C99
 /* Find the first occurrence of WC in WCS.  */
 extern wchar_t *wcschr (__const wchar_t *__wcs, wchar_t __wc)
      __THROW __attribute_pure__;
+libc_hidden_proto(wcschr)
 /* Find the last occurrence of WC in WCS.  */
 extern wchar_t *wcsrchr (__const wchar_t *__wcs, wchar_t __wc)
      __THROW __attribute_pure__;
@@ -243,6 +244,7 @@ __END_NAMESPACE_C99
    the closing NUL wide character in case C is not found in S.  */
 extern wchar_t *wcschrnul (__const wchar_t *__s, wchar_t __wc)
      __THROW __attribute_pure__;
+libc_hidden_proto(wcschrnul)
 #endif
 
 __BEGIN_NAMESPACE_C99

+ 2 - 2
libc/misc/fnmatch/fnmatch.c

@@ -90,8 +90,8 @@
 /* libc_hidden_proto(wmemchr) */
 /* libc_hidden_proto(wmempcpy) */
 /* libc_hidden_proto(wcscat) */
-/*libc_hidden_proto(wcschr)*/
-/*libc_hidden_proto(wcschrnul)*/
+/* libc_hidden_proto(wcschr) */
+/* libc_hidden_proto(wcschrnul) */
 /* libc_hidden_proto(wcslen) */
 /* libc_hidden_proto(wcscoll) */
 /* libc_hidden_proto(towlower) */

+ 0 - 2
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;

+ 0 - 2
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;

+ 0 - 2
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;

+ 0 - 2
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;

+ 0 - 2
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 {

+ 0 - 2
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;

+ 0 - 3
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

+ 6 - 3
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

+ 10 - 11
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

+ 0 - 2
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;

+ 0 - 2
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;

+ 0 - 2
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;

+ 0 - 2
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;