diff options
author | Karl Williamson <khw@cpan.org> | 2022-12-05 07:46:27 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-12-06 06:40:49 -0700 |
commit | 6125a5e74d95da8dad5982a6bf7c8cbe3801e632 (patch) | |
tree | 6d6cd320db314df2fa917fb2329c940580d704d2 /perl.h | |
parent | 44282561d32a069322c5641afa41adf8fd82b77e (diff) | |
download | perl-6125a5e74d95da8dad5982a6bf7c8cbe3801e632.tar.gz |
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.
Diffstat (limited to 'perl.h')
-rw-r--r-- | perl.h | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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 |