Browse Source

Sync w/ glibc and disable everything uClibc does not provide

Peter S. Mazinger 18 years ago
parent
commit
bacb3513d9
2 changed files with 23 additions and 29 deletions
  1. 19 29
      include/string.h
  2. 4 0
      libc/string/wstring.c

+ 19 - 29
include/string.h

@@ -111,8 +111,7 @@ extern size_t strxfrm (char *__restrict __dest,
      __THROW __nonnull ((2));
 __END_NAMESPACE_STD
 
-#ifdef __UCLIBC_HAS_XLOCALE__
-#ifdef __USE_GNU
+#if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__
 /* The following functions are equivalent to the both above but they
    take the locale they use for the collation as an extra argument.
    This is not standardsized but something like will come.  */
@@ -121,17 +120,10 @@ __END_NAMESPACE_STD
 /* Compare the collated forms of S1 and S2 using rules from L.  */
 extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l)
      __THROW __attribute_pure__ __nonnull ((1, 2, 3));
-extern int __strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l)
-     __THROW __attribute_pure__ __nonnull ((1, 2, 3));
-
 /* Put a transformation of SRC into no more than N bytes of DEST.  */
 extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n,
 			 __locale_t __l) __THROW __nonnull ((2, 4));
-extern size_t __strxfrm_l (char *__dest, __const char *__src, size_t __n,
-			 __locale_t __l) __THROW __nonnull ((2, 4));
-
 #endif
-#endif /* __UCLIBC_HAS_XLOCALE__ */
 
 #if defined __USE_SVID || defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 /* Duplicate S, returning an identical malloc'd string.  */
@@ -210,10 +202,12 @@ __END_NAMESPACE_STD
 
 /* Divide S into tokens separated by characters in DELIM.  Information
    passed between calls are stored in SAVE_PTR.  */
+#if 0 /* uClibc: disabled */
 extern char *__strtok_r (char *__restrict __s,
 			 __const char *__restrict __delim,
 			 char **__restrict __save_ptr)
      __THROW __nonnull ((2, 3));
+#endif
 #if defined __USE_POSIX || defined __USE_MISC
 extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
 		       char **__restrict __save_ptr)
@@ -265,12 +259,6 @@ __BEGIN_NAMESPACE_STD
 /* Return a string describing the meaning of the `errno' code in ERRNUM.  */
 extern char *strerror (int __errnum) __THROW;
 __END_NAMESPACE_STD
-
-extern char *__glibc_strerror_r (int __errnum, char *__buf, size_t __buflen)
-     __THROW __nonnull ((2));
-extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen)
-     __THROW __nonnull ((2));
-
 #if defined __USE_XOPEN2K || defined __USE_MISC
 /* Reentrant version of `strerror'.
    There are 2 flavors of `strerror_r', GNU which returns the string
@@ -282,8 +270,10 @@ extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen)
 # if defined __USE_XOPEN2K && !defined __USE_GNU
 /* Fill BUF with a string describing the meaning of the `errno' code in
    ERRNUM.  */
-#  ifdef __REDIRECT
-extern int __REDIRECT (strerror_r,
+extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen)
+     __THROW __nonnull ((2));
+#  ifdef __REDIRECT_NTH
+extern int __REDIRECT_NTH (strerror_r,
 			   (int __errnum, char *__buf, size_t __buflen),
 			   __xpg_strerror_r) __nonnull ((2));
 #  else
@@ -292,8 +282,10 @@ extern int __REDIRECT (strerror_r,
 # else
 /* If a temporary buffer is required, at most BUFLEN bytes of BUF will be
    used.  */
-#  ifdef __REDIRECT
-extern char * __REDIRECT (strerror_r,
+extern char *__glibc_strerror_r (int __errnum, char *__buf, size_t __buflen)
+     __THROW __nonnull ((2));
+#  ifdef __REDIRECT_NTH
+extern char * __REDIRECT_NTH (strerror_r,
 			   (int __errnum, char *__buf, size_t __buflen),
 			   __glibc_strerror_r) __nonnull ((2));
 #  else
@@ -334,7 +326,7 @@ extern int ffs (int __i) __THROW __attribute__ ((__const__));
 
 /* The following two functions are non-standard but necessary for non-32 bit
    platforms.  */
-# ifdef	__USE_GNU
+#if 0 /*def	__USE_GNU*/
 extern int ffsl (long int __l) __THROW __attribute__ ((__const__));
 #  ifdef __GNUC__
 __extension__ extern int ffsll (long long int __ll)
@@ -351,25 +343,17 @@ extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 #endif /* Use BSD.  */
 
-#ifdef __UCLIBC_HAS_XLOCALE__
-#ifdef	__USE_GNU
+#if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__
 /* Again versions of a few functions which use the given locale instead
    of the global one.  */
 extern int strcasecmp_l (__const char *__s1, __const char *__s2,
 			 __locale_t __loc)
      __THROW __attribute_pure__ __nonnull ((1, 2, 3));
-extern int __strcasecmp_l (__const char *__s1, __const char *__s2,
-			 __locale_t __loc)
-     __THROW __attribute_pure__ __nonnull ((1, 2, 3));
 
 extern int strncasecmp_l (__const char *__s1, __const char *__s2,
 			  size_t __n, __locale_t __loc)
      __THROW __attribute_pure__ __nonnull ((1, 2, 4));
-extern int __strncasecmp_l (__const char *__s1, __const char *__s2,
-			  size_t __n, __locale_t __loc)
-     __THROW __attribute_pure__ __nonnull ((1, 2, 4));
 #endif
-#endif /* __UCLIBC_HAS_XLOCALE__ */
 
 #ifdef	__USE_BSD
 /* Return the next DELIM-delimited token from *STRINGP,
@@ -381,23 +365,29 @@ extern char *strsep (char **__restrict __stringp,
 
 #ifdef	__USE_GNU
 /* Compare S1 and S2 as strings holding name & indices/version numbers.  */
+#if 0
 extern int strverscmp (__const char *__s1, __const char *__s2)
      __THROW __attribute_pure__ __nonnull ((1, 2));
+#endif
 
 /* Return a string describing the meaning of the signal number in SIG.  */
 extern char *strsignal (int __sig) __THROW;
 
 /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST.  */
+#if 0 /* uClibc: disabled */
 extern char *__stpcpy (char *__restrict __dest, __const char *__restrict __src)
      __THROW __nonnull ((1, 2));
+#endif
 extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src)
      __THROW __nonnull ((1, 2));
 
 /* Copy no more than N characters of SRC to DEST, returning the address of
    the last character written into DEST.  */
+#if 0 /* uClibc: disabled */
 extern char *__stpncpy (char *__restrict __dest,
 			__const char *__restrict __src, size_t __n)
      __THROW __nonnull ((1, 2));
+#endif
 extern char *stpncpy (char *__restrict __dest,
 		      __const char *__restrict __src, size_t __n)
      __THROW __nonnull ((1, 2));

+ 4 - 0
libc/string/wstring.c

@@ -73,6 +73,10 @@ extern wchar_t *__wcscpy (wchar_t *__restrict __dest,
 			__const wchar_t *__restrict __src) attribute_hidden;
 extern size_t __wcsspn (__const wchar_t *__wcs, __const wchar_t *__accept) attribute_hidden;
 extern wchar_t *__wcspbrk (__const wchar_t *__wcs, __const wchar_t *__accept) attribute_hidden;
+extern int __strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l) attribute_hidden;
+extern size_t __strxfrm_l (char *__dest, __const char *__src, size_t __n, __locale_t) attribute_hidden;
+extern int __strcasecmp_l (__const char *__s1, __const char *__s2, __locale_t __loc) attribute_hidden;
+extern int __strncasecmp_l (__const char *__s1, __const char *__s2, size_t __n, __locale_t __loc) attribute_hidden;
 #endif
 
 /**********************************************************************/