[git commit] locale.h, xlocale.h: guard *locale functions correctly

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Fri Jun 15 12:00:21 UTC 2012


commit: http://git.uclibc.org/uClibc/commit/?id=9414f108db466019b6d4fb7ff5d74afc0a6cc285
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

change the guard from LOCALE to XLOCALE for uselocale/newlocale...
move locale_t to xlocale.h

Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 include/locale.h  |    7 +------
 include/xlocale.h |    6 +++---
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/include/locale.h b/include/locale.h
index b79626a..a1bff85 100644
--- a/include/locale.h
+++ b/include/locale.h
@@ -133,7 +133,7 @@ libc_hidden_proto(localeconv)
 __END_NAMESPACE_STD
 
 
-#if defined __USE_XOPEN2K8 && defined __UCLIBC_HAS_LOCALE__
+#if defined __USE_XOPEN2K8 && defined __UCLIBC_HAS_XLOCALE__
 /* 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
@@ -145,13 +145,8 @@ __END_NAMESPACE_STD
    Attention: all these functions are *not* standardized in any form.
    This is a proof-of-concept implementation.  */
 
-#ifdef __UCLIBC_HAS_XLOCALE__
 /* Get locale datatype definition.  */
 # include <xlocale.h>
-#endif
-
-/* POSIX 2008 makes locale_t official.  */
-typedef __locale_t locale_t;
 
 /* Return a reference to a data structure representing a set of locale
    datasets.  Unlike for the CATEGORY parameter for `setlocale' the
diff --git a/include/xlocale.h b/include/xlocale.h
index 82dabdf..e3def34 100644
--- a/include/xlocale.h
+++ b/include/xlocale.h
@@ -39,11 +39,11 @@ typedef struct __locale_struct
   /* Note: LC_ALL is not a valid index into this array.  */
   const char *__names[13];
 } *__locale_t;
+#else
+# include <bits/uClibc_locale.h>
+#endif
 
 /* POSIX 2008 makes locale_t official.  */
 typedef __locale_t locale_t;
-#else
-# include <locale.h>
-#endif
 
 #endif /* xlocale.h */


More information about the uClibc-cvs mailing list