X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Flocalename.c;h=d2554fd96967924faf2f606336fcc3549cef6528;hb=f03c8d5562c251bfa6850372bb68d8eb346205f8;hp=03328b9ec1675ee01b53bce5f5ce69e97f21b5c9;hpb=52d1d6a50dbe687f788b93ccc4a754bbf6ee0d46;p=gnulib.git diff --git a/lib/localename.c b/lib/localename.c index 03328b9ec..d2554fd96 100644 --- a/lib/localename.c +++ b/lib/localename.c @@ -1,5 +1,5 @@ /* Determine name of the currently selected locale. - Copyright (C) 1995-1999, 2000-2009 Free Software Foundation, Inc. + Copyright (C) 1995-2010 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published @@ -2592,20 +2592,22 @@ struniq (const char *string) #endif +#if defined IN_LIBINTL || HAVE_USELOCALE + /* Like gl_locale_name_thread, except that the result is not in storage of indefinite extent. */ -#if !defined IN_LIBINTL +# if !defined IN_LIBINTL static -#endif +# endif const char * gl_locale_name_thread_unsafe (int category, const char *categoryname) { -#if HAVE_USELOCALE +# if HAVE_USELOCALE { locale_t thread_locale = uselocale (NULL); if (thread_locale != LC_GLOBAL_LOCALE) { -# if __GLIBC__ >= 2 +# if __GLIBC__ >= 2 /* Work around an incorrect definition of the _NL_LOCALE_NAME macro in glibc < 2.12. See . */ @@ -2616,8 +2618,8 @@ gl_locale_name_thread_unsafe (int category, const char *categoryname) nl_langinfo (_NL_LOCALE_NAME (category)). */ name = thread_locale->__names[category]; return name; -# endif -# if defined __APPLE__ && defined __MACH__ /* MacOS X */ +# endif +# if defined __APPLE__ && defined __MACH__ /* MacOS X */ /* The locale name is found deep in an undocumented data structure. Since it's stored in a buffer of size 32 and newlocale() rejects locale names of length > 31, we can assume that it is NUL terminated @@ -2715,13 +2717,15 @@ gl_locale_name_thread_unsafe (int category, const char *categoryname) default: /* We shouldn't get here. */ return ""; } -# endif +# endif } } -#endif +# endif return NULL; } +#endif + const char * gl_locale_name_thread (int category, const char *categoryname) {