From: Bruno Haible Date: Thu, 29 Nov 2001 13:21:40 +0000 (+0000) Subject: Merge with glibc: Don't make _nl_locale_name visible in glibc. X-Git-Tag: v0.11~253 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4993ad3ed44a4d2d21e6c7d270f1818f7c4f2d46;p=thirdparty%2Fgettext.git Merge with glibc: Don't make _nl_locale_name visible in glibc. --- diff --git a/intl/ChangeLog b/intl/ChangeLog index 9fbae8f82..64229a3cb 100644 --- a/intl/ChangeLog +++ b/intl/ChangeLog @@ -1,3 +1,13 @@ +2001-11-29 Bruno Haible + + * gettextP.h (_nl_locale_name): Don't declare inside glibc. + * localename.c (_nl_locale_name): Remove _LIBC conditional. + +2001-11-27 Ulrich Drepper + + * dcigettext.c (guess_category_value): Inside glibc, use setlocale + directly, not _nl_locale_name. + 2001-11-27 Ulrich Drepper * loadmsgcat.c (_nl_init_domain_conv): Modify #if expression. diff --git a/intl/dcigettext.c b/intl/dcigettext.c index 829666618..cf60cafd9 100644 --- a/intl/dcigettext.c +++ b/intl/dcigettext.c @@ -1067,9 +1067,14 @@ guess_category_value (category, categoryname) if (language != NULL && language[0] == '\0') language = NULL; - /* Proceed with the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and - 'LANG'. */ + /* We have to proceed with the POSIX methods of looking to `LC_ALL', + `LC_xxx', and `LANG'. On some systems this can be done by the + `setlocale' function itself. */ +#ifdef _LIBC + retval = setlocale (category, NULL); +#else retval = _nl_locale_name (category, categoryname); +#endif /* Ignore LANGUAGE if the locale is set to "C" because 1. "C" locale usually uses the ASCII encoding, and most international diff --git a/intl/gettextP.h b/intl/gettextP.h index bf77e5658..3efb53474 100644 --- a/intl/gettextP.h +++ b/intl/gettextP.h @@ -122,7 +122,10 @@ struct binding This variable is part of the external ABI of the GNU libintl. */ extern int _nl_msg_cat_cntr; +#ifndef _LIBC const char *_nl_locale_name PARAMS ((int category, const char *categoryname)); +#endif + struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname, char *__locale, const char *__domainname, diff --git a/intl/localename.c b/intl/localename.c index 2bca36604..a8aad600f 100644 --- a/intl/localename.c +++ b/intl/localename.c @@ -372,7 +372,7 @@ _nl_locale_name (category, categoryname) /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'. On some systems this can be done by the 'setlocale' function itself. */ -# if defined _LIBC || (defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL) +# if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL retval = setlocale (category, NULL); # else /* Setting of LC_ALL overwrites all other. */