svn commit: trunk/uClibc: include libc/misc/locale libc/misc/time

psm at uclibc.org psm at uclibc.org
Fri Dec 9 20:49:48 UTC 2005


Author: psm
Date: 2005-12-09 12:49:27 -0800 (Fri, 09 Dec 2005)
New Revision: 12784

Log:
Do __nl_langinfo, partly sync header w/ glibc, add missing nl_langinfo_l, change users to hidden version

Modified:
   trunk/uClibc/include/langinfo.h
   trunk/uClibc/libc/misc/locale/locale.c
   trunk/uClibc/libc/misc/time/time.c


Changeset:
Modified: trunk/uClibc/include/langinfo.h
===================================================================
--- trunk/uClibc/include/langinfo.h	2005-12-09 19:37:05 UTC (rev 12783)
+++ trunk/uClibc/include/langinfo.h	2005-12-09 20:49:27 UTC (rev 12784)
@@ -606,7 +606,7 @@
 
 
 #ifdef __UCLIBC_HAS_XLOCALE__
-#ifdef  __USE_GNU
+#ifdef	__USE_GNU
 /* This interface is for the extended locale model.  See <locale.h> for
    more information.  */
 
@@ -614,12 +614,7 @@
 # include <xlocale.h>
 
 /* Just like nl_langinfo but get the information from the locale object L.  */
-#ifdef __UCLIBC_MJN3_ONLY__
-#warning "mjn3 FIXME: nl_langinfo_l has a prototype but isn't defined."
-#endif
 extern char *nl_langinfo_l (nl_item __item, __locale_t l);
-extern char *__nl_langinfo_l (nl_item __item, __locale_t l);
-
 #endif
 #endif
 

Modified: trunk/uClibc/libc/misc/locale/locale.c
===================================================================
--- trunk/uClibc/libc/misc/locale/locale.c	2005-12-09 19:37:05 UTC (rev 12783)
+++ trunk/uClibc/libc/misc/locale/locale.c	2005-12-09 20:49:27 UTC (rev 12784)
@@ -1002,7 +1002,7 @@
 	   ']', '\x00',    '^',    '[',    'n',    'N',    ']', '\x00', 
 };
 
-char *nl_langinfo(nl_item item)
+char attribute_hidden *__nl_langinfo(nl_item item)
 {
 	unsigned int c;
 	unsigned int i;
@@ -1015,21 +1015,25 @@
 	}
 	return (char *) cat_start;	/* Conveniently, this is the empty string. */
 }
+strong_alias(__nl_langinfo,nl_langinfo)
 
 #else  /* __LOCALE_C_ONLY */
 
 #if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE)
 
-char *nl_langinfo(nl_item item)
+extern char *__nl_langinfo_l (nl_item __item, __locale_t l) attribute_hidden;
+
+char attribute_hidden *__nl_langinfo(nl_item item)
 {
 	return __nl_langinfo_l(item, __UCLIBC_CURLOCALE);
 }
+strong_alias(__nl_langinfo,nl_langinfo)
 
 #else  /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
 
 static const char empty[] = "";
 
-char *__XL(nl_langinfo)(nl_item item   __LOCALE_PARAM )
+char attribute_hidden *__UCXL(nl_langinfo)(nl_item item   __LOCALE_PARAM )
 {
 	unsigned int c = _NL_ITEM_CATEGORY(item);
 	unsigned int i = _NL_ITEM_INDEX(item);
@@ -1041,6 +1045,7 @@
 
 	return (char *) empty;
 }
+__UCXL_ALIAS(nl_langinfo)
 
 #endif /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
 

Modified: trunk/uClibc/libc/misc/time/time.c
===================================================================
--- trunk/uClibc/libc/misc/time/time.c	2005-12-09 19:37:05 UTC (rev 12783)
+++ trunk/uClibc/libc/misc/time/time.c	2005-12-09 20:49:27 UTC (rev 12784)
@@ -152,6 +152,8 @@
 			char **__restrict __endptr, int __base)
      __THROW __nonnull ((1)) __wur attribute_hidden;
 
+extern char *__nl_langinfo (nl_item __item) __THROW attribute_hidden;
+
 #ifdef __UCLIBC_HAS_XLOCALE__
 #include <xlocale.h>
 extern long int __strtol_l (__const char *__restrict __nptr,
@@ -168,6 +170,8 @@
 extern char *__strptime_l (__const char *__restrict __s,
 			 __const char *__restrict __fmt, struct tm *__tp,
 			 __locale_t __loc) __THROW attribute_hidden;
+
+extern char *__nl_langinfo_l (nl_item __item, __locale_t l) attribute_hidden;
 #endif
 
 #ifndef __isleap
@@ -1052,7 +1056,7 @@
 				+ (code & 7);
 #ifdef ENABLE_ERA_CODE
 			if ((mod & NO_E_MOD) /* Actually, this means E modifier present. */
-				&& (*(o = __XL(nl_langinfo)(_NL_ITEM(LC_TIME,
+				&& (*(o = __UCXL(nl_langinfo)(_NL_ITEM(LC_TIME,
 											 (int)(((unsigned char *)p)[4]))
 											__LOCALE_ARG
 									  )))
@@ -1061,7 +1065,7 @@
 				goto LOOP;
 			}
 #endif
-			p = __XL(nl_langinfo)(_NL_ITEM(LC_TIME,
+			p = __UCXL(nl_langinfo)(_NL_ITEM(LC_TIME,
 									 (int)(*((unsigned char *)p)))
 								  __LOCALE_ARG
 								  );
@@ -1238,7 +1242,7 @@
 		if ((code & MASK_SPEC) == STRING_SPEC) {
 			o_count = SIZE_MAX;
 			field_val += spec[STRINGS_NL_ITEM_START + (code & 0xf)];
-			o = __XL(nl_langinfo)(_NL_ITEM(LC_TIME, field_val)  __LOCALE_ARG );
+			o = __UCXL(nl_langinfo)(_NL_ITEM(LC_TIME, field_val)  __LOCALE_ARG );
 		} else {
 			o_count = ((i >> 1) & 3) + 1;
 			o = buf + o_count;
@@ -1499,7 +1503,7 @@
 				+ (code & 7);
 #ifdef ENABLE_ERA_CODE
 			if ((mod & NO_E_MOD) /* Actually, this means E modifier present. */
-				&& (*(o = __XL(nl_langinfo)(_NL_ITEM(LC_TIME,
+				&& (*(o = __UCXL(nl_langinfo)(_NL_ITEM(LC_TIME,
 											  (int)(((unsigned char *)p)[4]))
 											__LOCALE_ARG
 											)))
@@ -1508,7 +1512,7 @@
 				goto LOOP;
 			}
 #endif
-			p = __XL(nl_langinfo)(_NL_ITEM(LC_TIME,
+			p = __UCXL(nl_langinfo)(_NL_ITEM(LC_TIME,
 										   (int)(*((unsigned char *)p)))
 								  __LOCALE_ARG );
 			goto LOOP;
@@ -1523,7 +1527,7 @@
 			/* Go backwards to check full names before abreviations. */
 			do {
 				--j;
-				o = __XL(nl_langinfo)(i+j   __LOCALE_ARG);
+				o = __UCXL(nl_langinfo)(i+j   __LOCALE_ARG);
 				if (!__UCXL(strncasecmp)(buf,o,__strlen(o)   __LOCALE_ARG) && *o) {
 					do {		/* Found a match. */
 						++buf;




More information about the uClibc-cvs mailing list