From 6125a5e74d95da8dad5982a6bf7c8cbe3801e632 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Mon, 5 Dec 2022 07:46:27 -0700 Subject: locales: Add LC_NAME capabilities LC_NAME is a GNU extension that Perl hadn't been aware of. The consequences were that it couldn't be set or queried in Perl (except by using LC_ALL to set everything). There are other GNU extensions that Perl has long known about; this was the only missing one. The values associated with this category are retrievable by the glibc call nl_langinfo(3) in XS code. The standard-specified items are retrievable from pure Perl via I18N::Langinfo, but it doesn't know only about any of the non-standard ones, including the ones for this category. --- perl.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'perl.h') diff --git a/perl.h b/perl.h index 98bdf94b27..7d96132dd1 100644 --- a/perl.h +++ b/perl.h @@ -1129,6 +1129,9 @@ violations are fatal. # if !defined(NO_LOCALE_TELEPHONE) && defined(LC_TELEPHONE) # define USE_LOCALE_TELEPHONE # endif +# if !defined(NO_LOCALE_NAME) && defined(LC_NAME) +# define USE_LOCALE_NAME +# endif # if !defined(NO_LOCALE_SYNTAX) && defined(LC_SYNTAX) # define USE_LOCALE_SYNTAX # endif @@ -1203,11 +1206,17 @@ violations are fatal. # else # define PERL_DUMMY_TELEPHONE_ PERL_DUMMY_PAPER_ # endif +# ifdef USE_LOCALE_NAME +# define LC_NAME_INDEX_ PERL_DUMMY_TELEPHONE_ + 1 +# define PERL_DUMMY_NAME_ LC_NAME_INDEX_ +# else +# define PERL_DUMMY_NAME_ PERL_DUMMY_TELEPHONE_ +# endif # ifdef USE_LOCALE_SYNTAX -# define LC_SYNTAX_INDEX_ PERL_DUMMY_TELEPHONE_ + 1 +# define LC_SYNTAX_INDEX_ PERL_DUMMY_NAME + 1 # define PERL_DUMMY_SYNTAX_ LC_SYNTAX_INDEX_ # else -# define PERL_DUMMY_SYNTAX_ PERL_DUMMY_TELEPHONE_ +# define PERL_DUMMY_SYNTAX_ PERL_DUMMY_NAME_ # endif # ifdef USE_LOCALE_TOD # define LC_TOD_INDEX_ PERL_DUMMY_SYNTAX_ + 1 -- cgit v1.2.1