[uClibc-cvs] uClibc/libc/sysdeps/linux/common/bits uClibc_locale.h, 1.9, 1.10

Manuel Novoa III mjn3 at uclibc.org
Tue Sep 16 22:22:33 UTC 2003


Update of /var/cvs/uClibc/libc/sysdeps/linux/common/bits
In directory winder:/tmp/cvs-serv31146/libc/sysdeps/linux/common/bits

Modified Files:
	uClibc_locale.h 
Log Message:
This should enabled building of uClibc locale support when using uClibc itself.
Sorry I didn't test this before the release.

Please remember that the locale data generation tools are not very robust,
so doing something like disabling 8-bit codeset support is likely to break
things.  As it stands, UTF-8 support is required, but I'm not sure I test
for that.

Also, you will notice a difference in the locale data generated by uClibc
verses glibc.  That's because the bg_BG locale specifies use of grouping
in LC_NUMERIC, but supplies no grouping char.  The uClibc locale code
tests for and works around this (at the moment) by disabling grouping.
But the result is slightly different data which ripples throughout the
rest of the tables.



Index: uClibc_locale.h
===================================================================
RCS file: /var/cvs/uClibc/libc/sysdeps/linux/common/bits/uClibc_locale.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- uClibc_locale.h	28 Aug 2003 17:16:52 -0000	1.9
+++ uClibc_locale.h	16 Sep 2003 22:22:28 -0000	1.10
@@ -71,7 +71,9 @@
 #include <stdint.h>
 #include <bits/uClibc_touplow.h>
 
+#if defined(_LIBC) && !defined(__UCLIBC_GEN_LOCALE)
 #include <bits/uClibc_locale_data.h>
+#endif
 
 extern void _locale_set(const unsigned char *p);
 extern void _locale_init(void);
@@ -96,6 +98,7 @@
   * In particular, C/POSIX locale is '#' + "\x80\x01"}*LC_ALL + nul.
   */
 
+#if defined(_LIBC) && !defined(__UCLIBC_GEN_LOCALE)
 typedef struct {
 	uint16_t num_weights;
 	uint16_t num_starters;
@@ -139,7 +142,7 @@
 
 /*  static unsigned char cur_locale[LOCALE_STRING_SIZE]; */
 
-typedef struct {
+typedef struct __uclibc_locale_struct {
 #ifdef __UCLIBC_HAS_XLOCALE__
 	const __ctype_mask_t *__ctype_b;
 	const __ctype_touplow_t *__ctype_tolower;
@@ -311,10 +314,10 @@
 
 } __uclibc_locale_t;
 
-typedef __uclibc_locale_t *__locale_t;
-
-extern __locale_t __global_locale;
+extern struct __uclibc_locale_struct * __global_locale;
+#endif
 
+typedef struct __uclibc_locale_struct *__locale_t;
 
 extern int __locale_mbrtowc_l(wchar_t *__restrict dst,
 							  const char *__restrict src,




More information about the uClibc-cvs mailing list