svn commit: trunk/uClibc: extra/locale include libc/misc/ctype lib etc...

Bernhard Fischer rep.dot.nop at gmail.com
Tue May 20 07:51:37 UTC 2008


On Mon, May 19, 2008 at 08:24:15AM -0700, carmelo at uclibc.org wrote:
>Author: carmelo
>Date: 2008-05-19 08:24:14 -0700 (Mon, 19 May 2008)
>New Revision: 22011
>
>Log:
>Added a bounch of locale fixes.

This breaks compilation for me (who does not need no stinkin' locale ;):


  CC libc/misc/ctype/isalnum.os
In file included from libc/misc/ctype/ctype.c:37,
                 from libc/misc/ctype/isalnum.c:8:
./include/locale.h:152: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'locale_t'
./include/locale.h:158: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'newlocale'
./include/locale.h:206: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'duplocale'
./include/locale.h:210: error: expected ')' before '__dataset'
./include/locale.h:217: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'uselocale'
make[1]: *** [libc/misc/ctype/isalnum.os] Error 1


>* extra/locale/gen_wc8bit.c: use strrchr to parse locale
>  name to handle the case in which it contains a '.' character
>  like ANSI_X3.4-1968
>
>* include/locale.h: use __UCLIBC_HAS_XLOCALE__ to control
>  inclusion of xlocale.h only
>
>* libc/misc/ctype/ctype.c: add missing weak_alias for
>  __tolower_l and __toupper_l
>
>* libc/misc/locale/locale.c: use strcasecmp (case insensitive)
>  for utf-8 locale name.

Those should have been distinct commits imo.

Please fix the !locale config.
TIA,

>
>Signed-off-by: Carmelo Amoroso <carmelo.amoroso at st.com>
>
>
>Modified:
>   trunk/uClibc/extra/locale/gen_wc8bit.c
>   trunk/uClibc/include/locale.h
>   trunk/uClibc/libc/misc/ctype/ctype.c
>   trunk/uClibc/libc/misc/locale/locale.c
>
>
>Changeset:
>Modified: trunk/uClibc/extra/locale/gen_wc8bit.c
>===================================================================
>--- trunk/uClibc/extra/locale/gen_wc8bit.c	2008-05-19 10:28:32 UTC (rev 22010)
>+++ trunk/uClibc/extra/locale/gen_wc8bit.c	2008-05-19 15:24:14 UTC (rev 22011)
>@@ -189,7 +189,7 @@
> 			} else {
> 				++s0;
> 			}
>-			s1 = strchr(s0, '.');
>+			s1 = strrchr(s0, '.');
> 			if (!s1) {
> 				n = strlen(s0);
> 			} else {
>
>Modified: trunk/uClibc/include/locale.h
>===================================================================
>--- trunk/uClibc/include/locale.h	2008-05-19 10:28:32 UTC (rev 22010)
>+++ trunk/uClibc/include/locale.h	2008-05-19 15:24:14 UTC (rev 22011)
>@@ -132,7 +132,7 @@
> __END_NAMESPACE_STD
> 
> 
>-#if defined(__USE_GNU) && defined(__UCLIBC_HAS_XLOCALE__)
>+#if defined(__USE_GNU)
> /* The concept of one static locale per category is not very well
>    thought out.  Many applications will need to process its data using
>    information from several different locales.  Another application is
>@@ -144,8 +144,10 @@
>    Attention: all these functions are *not* standardized in any form.
>    This is a proof-of-concept implementation.  */
> 
>+#if defined(__UCLIBC_HAS_XLOCALE__)
> /* Get locale datatype definition.  */
> # include <xlocale.h>
>+#endif
> 
> typedef __locale_t locale_t;
> 
>
>Modified: trunk/uClibc/libc/misc/ctype/ctype.c
>===================================================================
>--- trunk/uClibc/libc/misc/ctype/ctype.c	2008-05-19 10:28:32 UTC (rev 22010)
>+++ trunk/uClibc/libc/misc/ctype/ctype.c	2008-05-19 15:24:14 UTC (rev 22011)
>@@ -316,6 +316,7 @@
> 	return __UCLIBC_CTYPE_IN_TO_DOMAIN(c) ? l->__ctype_tolower[c] : c;
> }
> libc_hidden_def(tolower_l)
>+weak_alias (tolower_l, __tolower_l)
> 
> #endif
> /**********************************************************************/
>@@ -362,6 +363,7 @@
> 	return __UCLIBC_CTYPE_IN_TO_DOMAIN(c) ? l->__ctype_toupper[c] : c;
> }
> libc_hidden_def(toupper_l)
>+weak_alias (toupper_l, __toupper_l)
> 
> #endif
> /**********************************************************************/
>
>Modified: trunk/uClibc/libc/misc/locale/locale.c
>===================================================================
>--- trunk/uClibc/libc/misc/locale/locale.c	2008-05-19 10:28:32 UTC (rev 22010)
>+++ trunk/uClibc/libc/misc/locale/locale.c	2008-05-19 15:24:14 UTC (rev 22011)
>@@ -1142,7 +1142,7 @@
> 		/* TODO: maybe CODESET_LIST + *s ??? */
> 		/* 7bit is 1, UTF-8 is 2, 8-bit is >= 3 */
> 		codeset = 2;
>-		if (strcmp(utf8,p+6) != 0) {/* TODO - fix! */
>+		if (strcasecmp(utf8,p+6) != 0) {/* TODO - fix! */
> 			s = CODESET_LIST;
> 			do {
> 				++codeset;		/* Increment codeset first. */
>
>_______________________________________________
>uClibc-cvs mailing list
>uClibc-cvs at uclibc.org
>http://busybox.net/cgi-bin/mailman/listinfo/uclibc-cvs



More information about the uClibc mailing list