diff options
Diffstat (limited to 'libc')
| -rw-r--r-- | libc/misc/ctype/Makefile.in | 4 | ||||
| -rw-r--r-- | libc/misc/ctype/ctype.c | 58 | ||||
| -rw-r--r-- | libc/misc/wchar/wchar.c | 4 | ||||
| -rw-r--r-- | libc/misc/wchar/wstdio.c | 2 | ||||
| -rw-r--r-- | libc/misc/wctype/wctype.c | 55 | 
5 files changed, 37 insertions, 86 deletions
| diff --git a/libc/misc/ctype/Makefile.in b/libc/misc/ctype/Makefile.in index 0e194cbff..87a3d11b1 100644 --- a/libc/misc/ctype/Makefile.in +++ b/libc/misc/ctype/Makefile.in @@ -10,7 +10,7 @@ MSRC:=ctype.c  MOBJ:=	isalnum.o isalpha.o isascii.o iscntrl.o isdigit.o \  	isgraph.o islower.o isprint.o ispunct.o isspace.o \  	isupper.o isxdigit.o toascii.o tolower.o toupper.o \ -	isblank.o isxlower.o isxupper.o +	isblank.o  ifeq ($(UCLIBC_HAS_CTYPE_TABLES),y)  MOBJ+=	__C_ctype_b.o __C_ctype_tolower.o __C_ctype_toupper.o \ @@ -21,7 +21,7 @@ endif  MOBJx:=	isalnum_l.o isalpha_l.o isascii_l.o iscntrl_l.o isdigit_l.o \  	isgraph_l.o islower_l.o isprint_l.o ispunct_l.o isspace_l.o \  	isupper_l.o isxdigit_l.o toascii_l.o tolower_l.o toupper_l.o \ -	isblank_l.o # isxlower_l.o isxupper_l.o +	isblank_l.o  MISC_CTYPE_DIR:=$(top_srcdir)libc/misc/ctype  MISC_CTYPE_OUT:=$(top_builddir)libc/misc/ctype diff --git a/libc/misc/ctype/ctype.c b/libc/misc/ctype/ctype.c index 65debd842..60301d48c 100644 --- a/libc/misc/ctype/ctype.c +++ b/libc/misc/ctype/ctype.c @@ -390,64 +390,6 @@ int toascii(int c)  #endif  /**********************************************************************/ -/* old uClibc extensions */ -/**********************************************************************/ -#ifdef L_isxlower - -#ifdef __UCLIBC_HAS_CTYPE_TABLES__ - -int isxlower(int C) -{ -#if defined(__UCLIBC_HAS_CTYPE_ENFORCED__) -	assert(CTYPE_DOMAIN_CHECK(C)); - 	return (__isctype(C, (_ISxdigit|_ISupper)) == _ISxdigit); -#elif defined(__UCLIBC_HAS_CTYPE_CHECKED__) -	return CTYPE_DOMAIN_CHECK(C) -		? (__isctype(C, (_ISxdigit|_ISupper)) == _ISxdigit) -		: 0; -#elif defined(__UCLIBC_HAS_CTYPE_UNSAFE__) -	return (__isctype(C, (_ISxdigit|_ISupper)) == _ISxdigit); -#else  /* No checking done. */ -#error Unknown type of ctype checking! -#endif -} - -#else  /* __UCLIBC_HAS_CTYPE_TABLES__ */ - -IS_FUNC_BODY(xlower); - -#endif /* __UCLIBC_HAS_CTYPE_TABLES__ */ - -#endif -/**********************************************************************/ -#ifdef L_isxupper - -#ifdef __UCLIBC_HAS_CTYPE_TABLES__ - -int isxupper(int C) -{ -#if defined(__UCLIBC_HAS_CTYPE_ENFORCED__) -	assert(CTYPE_DOMAIN_CHECK(C)); - 	return (__isctype(C, (_ISxdigit|_ISlower)) == _ISxdigit); -#elif defined(__UCLIBC_HAS_CTYPE_CHECKED__) -	return CTYPE_DOMAIN_CHECK(C) -		? (__isctype(C, (_ISxdigit|_ISlower)) == _ISxdigit) -		: 0; -#elif defined(__UCLIBC_HAS_CTYPE_UNSAFE__) -	return (__isctype(C, (_ISxdigit|_ISlower)) == _ISxdigit); -#else  /* No checking done. */ -#error Unknown type of ctype checking! -#endif -} - -#else  /* __UCLIBC_HAS_CTYPE_TABLES__ */ - -IS_FUNC_BODY(xupper); - -#endif /* __UCLIBC_HAS_CTYPE_TABLES__ */ - -#endif -/**********************************************************************/  /* glibc extensions */  /**********************************************************************/  #ifdef L_isctype diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c index 1a16fc9d6..36937cd5d 100644 --- a/libc/misc/wchar/wchar.c +++ b/libc/misc/wchar/wchar.c @@ -1586,7 +1586,7 @@ static void error_msg(const char *fmt, ...)  		va_end(arg);  	} -	exit(EXIT_FAILURE); +	__exit(EXIT_FAILURE);  }  int main(int argc, char **argv) @@ -1695,7 +1695,7 @@ int main(int argc, char **argv)  				}  			}  			if (ni) {			/* still bytes in buffer! */ -				memmove(ibuf, pi, ni); +				__memmove(ibuf, pi, ni);  			}  		} diff --git a/libc/misc/wchar/wstdio.c b/libc/misc/wchar/wstdio.c index b4ca4973f..55e7fef6b 100644 --- a/libc/misc/wchar/wstdio.c +++ b/libc/misc/wchar/wstdio.c @@ -289,7 +289,7 @@ UNLOCKED(wchar_t *,fgetws,(wchar_t *__restrict ws, int n,  	wint_t wi;  	while ((n > 1) -		   && ((wi = fgetwc_unlocked(stream)) != WEOF) +		   && ((wi = __fgetwc_unlocked(stream)) != WEOF)  		   && ((*p++ = wi) != '\n')  		   ) {  		--n; diff --git a/libc/misc/wctype/wctype.c b/libc/misc/wctype/wctype.c index 8ef373205..c98363d21 100644 --- a/libc/misc/wctype/wctype.c +++ b/libc/misc/wctype/wctype.c @@ -39,6 +39,8 @@  #include <bits/uClibc_uwchar.h>  extern wctype_t __wctype (__const char *__property) attribute_hidden; +extern wint_t __towlower (wint_t __wc) __THROW attribute_hidden; +extern wint_t __towupper (wint_t __wc) __THROW attribute_hidden;  #if defined(__LOCALE_C_ONLY) && defined(__UCLIBC_DO_XLOCALE)  #error xlocale functionality is not supported in stub locale mode. @@ -46,10 +48,10 @@ extern wctype_t __wctype (__const char *__property) attribute_hidden;  #ifdef __UCLIBC_HAS_XLOCALE__  #include <xlocale.h> -extern wint_t __towlower_l(wint_t __wc, __locale_t __locale) __THROW; -extern wint_t __towupper_l(wint_t __wc, __locale_t __locale) __THROW; +extern wint_t __towlower_l(wint_t __wc, __locale_t __locale) __THROW attribute_hidden; +extern wint_t __towupper_l(wint_t __wc, __locale_t __locale) __THROW attribute_hidden;  extern int __iswctype_l(wint_t __wc, wctype_t __desc, __locale_t __locale) __THROW attribute_hidden; -extern wint_t __towctrans_l(wint_t __wc, wctrans_t __desc, __locale_t __locale) __THROW; +extern wint_t __towctrans_l(wint_t __wc, wctrans_t __desc, __locale_t __locale) __THROW attribute_hidden;  #endif /* __UCLIBC_HAS_XLOCALE__ */  /* We know wide char support is enabled.  We wouldn't be here otherwise. */ @@ -278,7 +280,7 @@ ISW_FUNC_BODY(xdigit);  #if defined(L_towlower) || defined(L_towlower_l)  #ifdef L_towlower -#define TOWLOWER(w) towlower(w) +#define TOWLOWER(w) __towlower(w)  #else  /* L_towlower */  #define TOWLOWER(w) __towlower_l(w, __locale_t locale)  #undef __UCLIBC_CURLOCALE_DATA @@ -290,7 +292,7 @@ ISW_FUNC_BODY(xdigit);  #ifdef __UCLIBC_HAS_XLOCALE__  #define TOWCTRANS(w,d) __towctrans_l(w,d, __UCLIBC_CURLOCALE)  #else  /* __UCLIBC_HAS_XLOCALE__ */ -#define TOWCTRANS(w,d) towctrans(w,d) +#define TOWCTRANS(w,d) __towctrans(w,d)  #endif /* __UCLIBC_HAS_XLOCALE__ */  #define __C_towlower(wc) \ @@ -298,7 +300,7 @@ ISW_FUNC_BODY(xdigit);  #ifdef __LOCALE_C_ONLY -wint_t towlower(wint_t wc) +wint_t attribute_hidden __towlower(wint_t wc)  {  #ifdef __UCLIBC_HAS_CTYPE_TABLES__  	return __C_towlower(wc); @@ -315,14 +317,14 @@ wint_t towlower(wint_t wc)  #if defined(L_towlower) && defined(__UCLIBC_HAS_XLOCALE__) -wint_t towlower(wint_t wc) +wint_t attribute_hidden __towlower(wint_t wc)  {  	return __towctrans_l(wc, _CTYPE_tolower, __UCLIBC_CURLOCALE);  }  #else  /* defined(L_towlower) && defined(__UCLIBC_HAS_XLOCALE__) */ -wint_t TOWLOWER(wint_t wc) +wint_t attribute_hidden TOWLOWER(wint_t wc)  {  	return TOWCTRANS(wc, _CTYPE_tolower);  } @@ -333,14 +335,14 @@ wint_t TOWLOWER(wint_t wc)  #if defined(L_towlower) && defined(__UCLIBC_HAS_XLOCALE__) -wint_t towlower(wint_t wc) +wint_t attribute_hidden __towlower(wint_t wc)  {  	return __towlower_l(wc, __UCLIBC_CURLOCALE);  }  #else  /* defined(L_towlower) && defined(__UCLIBC_HAS_XLOCALE__) */ -wint_t TOWLOWER(wint_t wc) +wint_t attribute_hidden TOWLOWER(wint_t wc)  {  	unsigned int sc, n, i;  	__uwchar_t u = wc; @@ -371,17 +373,19 @@ wint_t TOWLOWER(wint_t wc)  #endif /* SMALL_UPLOW */  #ifdef L_towlower_l -weak_alias(__towlower_l, towlower_l) +strong_alias(__towlower_l,towlower_l)  #endif /* L_towlower_l */  #endif /* __LOCALE_C_ONLY */ +strong_alias(__towlower,towlower) +  #endif  /**********************************************************************/  #if defined(L_towupper) || defined(L_towupper_l)  #ifdef L_towupper -#define TOWUPPER(w) towupper(w) +#define TOWUPPER(w) __towupper(w)  #else  /* L_towupper */  #define TOWUPPER(w) __towupper_l(w, __locale_t locale)  #undef __UCLIBC_CURLOCALE_DATA @@ -393,7 +397,7 @@ weak_alias(__towlower_l, towlower_l)  #ifdef __UCLIBC_HAS_XLOCALE__  #define TOWCTRANS(w,d) __towctrans_l(w,d, __UCLIBC_CURLOCALE)  #else  /* __UCLIBC_HAS_XLOCALE__ */ -#define TOWCTRANS(w,d) towctrans(w,d) +#define TOWCTRANS(w,d) __towctrans(w,d)  #endif /* __UCLIBC_HAS_XLOCALE__ */  #define __C_towupper(wc) \ @@ -401,7 +405,7 @@ weak_alias(__towlower_l, towlower_l)  #ifdef __LOCALE_C_ONLY -wint_t towupper(wint_t wc) +wint_t attribute_hidden __towupper(wint_t wc)  {  #ifdef __UCLIBC_HAS_CTYPE_TABLES__  	return __C_towupper(wc); @@ -419,14 +423,14 @@ wint_t towupper(wint_t wc)  #if defined(L_towupper) && defined(__UCLIBC_HAS_XLOCALE__) -wint_t towupper(wint_t wc) +wint_t attribute_hidden __towupper(wint_t wc)  {  	return __towctrans_l(wc, _CTYPE_toupper, __UCLIBC_CURLOCALE);  }  #else  /* defined(L_towupper) && defined(__UCLIBC_HAS_XLOCALE__) */ -wint_t TOWUPPER(wint_t wc) +wint_t attribute_hidden TOWUPPER(wint_t wc)  {  	return TOWCTRANS(wc, _CTYPE_toupper);  } @@ -437,14 +441,14 @@ wint_t TOWUPPER(wint_t wc)  #if defined(L_towupper) && defined(__UCLIBC_HAS_XLOCALE__) -wint_t towupper(wint_t wc) +wint_t attribute_hidden __towupper(wint_t wc)  {  	return __towupper_l(wc, __UCLIBC_CURLOCALE);  }  #else  /* defined(L_towupper) && defined(__UCLIBC_HAS_XLOCALE__) */ -wint_t TOWUPPER(wint_t wc) +wint_t attribute_hidden TOWUPPER(wint_t wc)  {  	unsigned int sc, n, i;  	__uwchar_t u = wc; @@ -475,11 +479,13 @@ wint_t TOWUPPER(wint_t wc)  #endif /* SMALL_UPLOW */  #ifdef L_towupper_l -weak_alias(__towupper_l, towupper_l) +strong_alias(__towupper_l,towupper_l)  #endif /* L_towupper_l */  #endif /* __LOCALE_C_ONLY */ +strong_alias(__towupper,towupper) +  #endif  /**********************************************************************/  #ifdef L_wctype @@ -756,8 +762,8 @@ wint_t towctrans(wint_t wc, wctrans_t desc)  #define TOWLOWER(w,l) __towlower_l(w,l)  #define TOWUPPER(w,l) __towupper_l(w,l)  #else  /* __UCLIBC_HAS_XLOCALE__ */ -#define TOWLOWER(w,l) towlower(w) -#define TOWUPPER(w,l) towupper(w) +#define TOWLOWER(w,l) __towlower(w) +#define TOWUPPER(w,l) __towupper(w)  #endif /* __UCLIBC_HAS_XLOCALE__ */  #if defined(L_towctrans) && defined(__UCLIBC_HAS_XLOCALE__) @@ -883,7 +889,7 @@ weak_alias(__towctrans_l, towctrans_l)  static const char transstring[] = __CTYPE_TRANSTRING; -wctrans_t wctrans(const char *property) +wctrans_t attribute_hidden __wctrans(const char *property)  {  	const unsigned char *p;  	int i; @@ -901,6 +907,7 @@ wctrans_t wctrans(const char *property)  	/* TODO - Add locale-specific translations. */  	return 0;  } +strong_alias(__wctrans,wctrans)  #endif  /**********************************************************************/ @@ -910,9 +917,11 @@ wctrans_t wctrans(const char *property)  #warning REMINDER: Currently wctrans_l simply calls wctrans.  #endif /* __UCLIBC_MJN3_ONLY__ */ +extern wctrans_t __wctrans (__const char *__property) __THROW attribute_hidden; +  wctrans_t __wctrans_l(const char *property, __locale_t locale)  { -	return wctrans(property); +	return __wctrans(property);  }  weak_alias(__wctrans_l, wctrans_l) | 
