diff options
author | Andrew Fresh <afresh1@openbsd.org> | 2014-07-09 03:30:00 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2014-09-22 10:53:35 -0600 |
commit | b15c1b561a4d9a6ec5ecdf68b69fda7ef7d09cb7 (patch) | |
tree | f03b44e2bab9c6f0479deffc6b72e5a27f456c28 /ext | |
parent | c774046ba1377cc500a8a8fd88aa3cf810aad808 (diff) | |
download | perl-b15c1b561a4d9a6ec5ecdf68b69fda7ef7d09cb7.tar.gz |
PATCH: [perl #122252] international currency formatting (POSIX.1-2008)
Add the new portions of locale currency formatting that are specified in
POSIX.1-2008
The commiter (Karl Williamson) made the trivial indentation changes
asked for by H. Merijn Brand, and added a perldelta entry
Diffstat (limited to 'ext')
-rw-r--r-- | ext/POSIX/POSIX.xs | 8 | ||||
-rw-r--r-- | ext/POSIX/lib/POSIX.pm | 2 | ||||
-rw-r--r-- | ext/POSIX/lib/POSIX.pod | 9 | ||||
-rw-r--r-- | ext/POSIX/t/posix.t | 22 |
4 files changed, 37 insertions, 4 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index dcda63170f..d84db98e91 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -1218,6 +1218,14 @@ const struct lconv_offset lconv_integers[] = { {"n_sep_by_space", STRUCT_OFFSET(struct lconv, n_sep_by_space)}, {"p_sign_posn", STRUCT_OFFSET(struct lconv, p_sign_posn)}, {"n_sign_posn", STRUCT_OFFSET(struct lconv, n_sign_posn)}, +#ifdef HAS_LC_MONETARY_2008 + {"int_p_cs_precedes", STRUCT_OFFSET(struct lconv, int_p_cs_precedes)}, + {"int_p_sep_by_space", STRUCT_OFFSET(struct lconv, int_p_sep_by_space)}, + {"int_n_cs_precedes", STRUCT_OFFSET(struct lconv, int_n_cs_precedes)}, + {"int_n_sep_by_space", STRUCT_OFFSET(struct lconv, int_n_sep_by_space)}, + {"int_p_sign_posn", STRUCT_OFFSET(struct lconv, int_p_sign_posn)}, + {"int_n_sign_posn", STRUCT_OFFSET(struct lconv, int_n_sign_posn)}, +#endif #endif {NULL, 0} }; diff --git a/ext/POSIX/lib/POSIX.pm b/ext/POSIX/lib/POSIX.pm index 0b236d21e9..be1f09767d 100644 --- a/ext/POSIX/lib/POSIX.pm +++ b/ext/POSIX/lib/POSIX.pm @@ -4,7 +4,7 @@ use warnings; our ($AUTOLOAD, %SIGRT); -our $VERSION = '1.43'; +our $VERSION = '1.44'; require XSLoader; diff --git a/ext/POSIX/lib/POSIX.pod b/ext/POSIX/lib/POSIX.pod index 82bc213083..1030540116 100644 --- a/ext/POSIX/lib/POSIX.pod +++ b/ext/POSIX/lib/POSIX.pod @@ -1036,12 +1036,21 @@ Here is how to query the database for the B<de> (Deutsch or German) locale. n_sep_by_space p_sign_posn n_sign_posn + int_p_cs_precedes + int_p_sep_by_space + int_n_cs_precedes + int_n_sep_by_space + int_p_sign_posn + int_n_sign_posn )) { printf qq(%s: "%s",\n), $property, $lconv->{$property}; } +int_p_* and int_n_* members added by POSIX.1-2008 are only available on +systems that support them. + =item C<localtime> This is identical to Perl's builtin C<localtime()> function for diff --git a/ext/POSIX/t/posix.t b/ext/POSIX/t/posix.t index da4aba8370..398928c74b 100644 --- a/ext/POSIX/t/posix.t +++ b/ext/POSIX/t/posix.t @@ -8,7 +8,7 @@ BEGIN { } } -use Test::More tests => 111; +use Test::More tests => 117; use POSIX qw(fcntl_h signal_h limits_h _exit getcwd open read strftime write errno localeconv dup dup2 lseek access); @@ -359,8 +359,24 @@ SKIP: { } } - foreach (qw(int_frac_digits frac_digits p_cs_precedes p_sep_by_space - n_cs_precedes n_sep_by_space p_sign_posn n_sign_posn)) { + my @lconv = qw( + int_frac_digits frac_digits + p_cs_precedes p_sep_by_space + n_cs_precedes n_sep_by_space + p_sign_posn n_sign_posn + ); + + SKIP: { + skip('No HAS_LC_MONETARY_2008', 6) unless $Config{d_lc_monetary_2008}; + + push @lconv, qw( + int_p_cs_precedes int_p_sep_by_space + int_n_cs_precedes int_n_sep_by_space + int_p_sign_posn int_n_sign_posn + ); + } + + foreach (@lconv) { SKIP: { skip("localeconv has no result for $_", 1) unless exists $conv->{$_}; |