mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Update to Gnulib v0.0-2923-g6575ab5.
This commit is contained in:
parent
6b1bc6e56a
commit
b3eba3b2ff
1 changed files with 2 additions and 17 deletions
|
@ -22,15 +22,8 @@
|
|||
#include <locale.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <langinfo.h>
|
||||
#include <string.h>
|
||||
|
||||
/* Work around an incorrect definition of the _NL_LOCALE_NAME macro in
|
||||
glibc < 2.12.
|
||||
See <http://sourceware.org/bugzilla/show_bug.cgi?id=10968>. */
|
||||
#undef _NL_LOCALE_NAME
|
||||
#define _NL_LOCALE_NAME(category) _NL_ITEM ((category), _NL_ITEM_INDEX (-1))
|
||||
|
||||
#define SIZEOF(a) (sizeof(a) / sizeof(a[0]))
|
||||
|
||||
#undef duplocale
|
||||
|
@ -74,10 +67,6 @@ rpl_duplocale (locale_t locale)
|
|||
locale_t base_copy;
|
||||
unsigned int i;
|
||||
|
||||
base_name = nl_langinfo (_NL_LOCALE_NAME (LC_CTYPE));
|
||||
if (base_name[0] == '\0')
|
||||
/* Fallback code for glibc < 2.4, which did not implement
|
||||
nl_langinfo (_NL_LOCALE_NAME (category)). */
|
||||
base_name = setlocale (LC_CTYPE, NULL);
|
||||
base_copy = newlocale (LC_ALL_MASK, base_name, NULL);
|
||||
if (base_copy == NULL)
|
||||
|
@ -87,11 +76,7 @@ rpl_duplocale (locale_t locale)
|
|||
{
|
||||
int category = categories[i].cat;
|
||||
int category_mask = categories[i].mask;
|
||||
const char *name = nl_langinfo (_NL_LOCALE_NAME (category));
|
||||
if (name[0] == '\0')
|
||||
/* Fallback code for glibc < 2.4, which did not implement
|
||||
nl_langinfo (_NL_LOCALE_NAME (category)). */
|
||||
name = setlocale (category, NULL);
|
||||
const char *name = setlocale (category, NULL);
|
||||
if (strcmp (name, base_name) != 0)
|
||||
{
|
||||
locale_t copy = newlocale (category_mask, name, base_copy);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue