summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xConfigure23
-rw-r--r--Cross/config.sh-arm-linux1
-rw-r--r--NetWare/config.wc1
-rw-r--r--Porting/Glossary5
-rw-r--r--Porting/config.sh1
-rwxr-xr-xconfig_h.SH6
-rw-r--r--configure.com2
-rw-r--r--ext/POSIX/POSIX.xs8
-rw-r--r--ext/POSIX/lib/POSIX.pm2
-rw-r--r--ext/POSIX/lib/POSIX.pod9
-rw-r--r--ext/POSIX/t/posix.t22
-rw-r--r--plan9/config_sh.sample1
-rw-r--r--pod/perldelta.pod15
-rw-r--r--symbian/config.sh1
-rw-r--r--uconfig.h10
-rw-r--r--uconfig.sh1
-rw-r--r--uconfig64.sh1
-rw-r--r--win32/config.ce1
-rw-r--r--win32/config.gc1
-rw-r--r--win32/config.vc1
20 files changed, 106 insertions, 6 deletions
diff --git a/Configure b/Configure
index 343e062741..95909f2675 100755
--- a/Configure
+++ b/Configure
@@ -600,6 +600,7 @@ d_localtime_r=''
d_localtime_r_needs_tzset=''
localtime_r_proto=''
d_locconv=''
+d_lc_monetary_2008=''
d_lockf=''
d_ldexpl=''
d_longdbl=''
@@ -15928,6 +15929,27 @@ $rm_try
set localeconv d_locconv
eval $inlibc
+: see if libc has the POSIX.1-2008 currency locale rules
+case "$d_locconv:$d_lc_monetary_2008" in
+ $define:)
+ $cat >try.c <<EOCP
+#include <locale.h>
+int main() {
+ struct lconv *lc = localeconv();
+ char int_p_cs_precedes = lc->int_p_cs_precedes;
+ return 0;
+}
+EOCP
+ set try
+ if eval $compile; then
+ d_lc_monetary_2008="$define"
+ else
+ d_lc_monetary_2008="$undef"
+ fi;
+ $rm_try
+ ;;
+esac
+
: see if lockf exists
set lockf d_lockf
eval $inlibc
@@ -23656,6 +23678,7 @@ d_localtime64='$d_localtime64'
d_localtime_r='$d_localtime_r'
d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
d_locconv='$d_locconv'
+d_lc_monetary_2008='$d_lc_monetary_2008'
d_lockf='$d_lockf'
d_longdbl='$d_longdbl'
d_longlong='$d_longlong'
diff --git a/Cross/config.sh-arm-linux b/Cross/config.sh-arm-linux
index 48b1d87444..69220aab58 100644
--- a/Cross/config.sh-arm-linux
+++ b/Cross/config.sh-arm-linux
@@ -307,6 +307,7 @@ d_isnanl='define'
d_j0='define'
d_j0l='define'
d_killpg='define'
+d_lc_monetary_2008='undef'
d_lchown='define'
d_ldbl_dig='define'
d_ldexpl='define'
diff --git a/NetWare/config.wc b/NetWare/config.wc
index 1407c443d1..6e19e53e8c 100644
--- a/NetWare/config.wc
+++ b/NetWare/config.wc
@@ -296,6 +296,7 @@ d_isnanl='undef'
d_j0='undef'
d_j0l='undef'
d_killpg='undef'
+d_lc_monetary_2008='undef'
d_lchown='undef'
d_ldbl_dig='define'
d_ldexpl='undef'
diff --git a/Porting/Glossary b/Porting/Glossary
index e28bb561a8..32b29e2613 100644
--- a/Porting/Glossary
+++ b/Porting/Glossary
@@ -1362,6 +1362,11 @@ d_killpg (d_killpg.U):
indicates to the C program that the killpg() routine is available
to kill process groups.
+d_lc_monetary_2008 (d_lc_monetary_2008.U):
+ This variable conditionally defines HAS_LC_MONETARY_2008 if libc
+ has the international currency locale rules from POSIX
+ 1003.1-2008.
+
d_lchown (d_lchown.U):
This variable conditionally defines the HAS_LCHOWN symbol, which
indicates to the C program that the lchown() routine is available
diff --git a/Porting/config.sh b/Porting/config.sh
index cb851684ae..18ac7401f4 100644
--- a/Porting/config.sh
+++ b/Porting/config.sh
@@ -316,6 +316,7 @@ d_isnanl='define'
d_j0='undef'
d_j0l='undef'
d_killpg='define'
+d_lc_monetary_2008='undef'
d_lchown='define'
d_ldbl_dig='define'
d_ldexpl='define'
diff --git a/config_h.SH b/config_h.SH
index 7aae94f05a..5b26b94e1c 100755
--- a/config_h.SH
+++ b/config_h.SH
@@ -261,6 +261,12 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
*/
#$d_locconv HAS_LOCALECONV /**/
+/* HAS_LC_MONETARY_2008:
+ * This symbol, if defined, indicates that the localeconv routine is
+ * available and has the additional members added in POSIX 1003.1-2008.
+ */
+#$d_lc_monetary_2008 HAS_LC_MONETARY_2008 /**/
+
/* HAS_LOCKF:
* This symbol, if defined, indicates that the lockf routine is
* available to do file locking.
diff --git a/configure.com b/configure.com
index 0bb1a75f03..2128bddae3 100644
--- a/configure.com
+++ b/configure.com
@@ -5398,6 +5398,7 @@ $ vms_cc_type="decc"
$ ENDIF
$ d_faststdio="define"
$ d_locconv="define"
+$ d_lc_monetary_2008="define"
$ d_mblen="define"
$ d_mbstowcs="define"
$ d_mbtowc="define"
@@ -6095,6 +6096,7 @@ $ WC "d_link='" + d_link + "'"
$ WC "d_llseek='undef'"
$ WC "d_localtime64='undef'"
$ WC "d_locconv='" + d_locconv + "'"
+$ WC "d_lc_monetary_2008='" + d_lc_monetary_2008 + "'"
$ WC "d_lockf='undef'"
$ WC "d_longdbl='" + d_longdbl + "'"
$ WC "d_longlong='" + d_longlong + "'"
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->{$_};
diff --git a/plan9/config_sh.sample b/plan9/config_sh.sample
index 8b32a82391..30012ce884 100644
--- a/plan9/config_sh.sample
+++ b/plan9/config_sh.sample
@@ -307,6 +307,7 @@ d_isnanl='undef'
d_j0='undef'
d_j0l='undef'
d_killpg='undef'
+d_lc_monetary_2008='undef'
d_lchown='undef'
d_ldbl_dig='define'
d_ldexpl='undef'
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index b9a97c2597..608c1df506 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -27,6 +27,21 @@ here, but most should go in the L</Performance Enhancements> section.
[ List each enhancement as a =head2 entry ]
+=head2 Perl now supports POSIX 2008 locale currency additions.
+
+On platforms that are able to handle POSIX.1-2008, the
+hash returned by
+L<C<POSIX::localeconv()>|perllocale/The localeconv function>
+includes the international currency fields added by that version of the
+POSIX standard. These are
+C<int_n_cs_precedes>,
+C<int_n_sep_by_space>,
+C<int_n_sign_posn>,
+C<int_p_cs_precedes>,
+C<int_p_sep_by_space>,
+and
+C<int_p_sign_posn>.
+
=head1 Security
XXX Any security-related notices go here. In particular, any security
diff --git a/symbian/config.sh b/symbian/config.sh
index 193b8db9b9..7496ae9f0c 100644
--- a/symbian/config.sh
+++ b/symbian/config.sh
@@ -253,6 +253,7 @@ d_isnanl='undef'
d_j0='undef'
d_j0l='undef'
d_killpg='undef'
+d_lc_monetary_2008='undef'
d_lchown='undef'
d_ldbl_dig='undef'
d_ldexpl='undef'
diff --git a/uconfig.h b/uconfig.h
index 81d5e063fe..dc6690ef0b 100644
--- a/uconfig.h
+++ b/uconfig.h
@@ -226,6 +226,12 @@
*/
/*#define HAS_LOCALECONV / **/
+/* HAS_LC_MONETARY_2008:
+ * This symbol, if defined, indicates that the localeconv routine is
+ * available and has the additional members added in POSIX 1003.1-2008.
+ */
+/*#define HAS_LC_MONETARY_2008 / **/
+
/* HAS_LOCKF:
* This symbol, if defined, indicates that the lockf routine is
* available to do file locking.
@@ -4865,6 +4871,6 @@
#endif
/* Generated from:
- * d7da79ac72d2191d6814ec98688e342f20eba70c64292c2e0b6b5622cdf3b6e6 config_h.SH
- * a3cd0b705a952f6915cc1424cc116d4183481f54ba9605415baf93bc57e12122 uconfig.sh
+ * 74bb96b6e7b18b5b5f121da4f2849cd5521bb55ff62d63970fedb9a7ebd80f63 config_h.SH
+ * 35023b2d9244ad2dc3abea4bb5174a7f66398b60266231cb9a2c3bfc8df867cf uconfig.sh
* ex: set ro: */
diff --git a/uconfig.sh b/uconfig.sh
index 0341bda083..d4199cda74 100644
--- a/uconfig.sh
+++ b/uconfig.sh
@@ -246,6 +246,7 @@ d_isnanl='undef'
d_j0='undef'
d_j0l='undef'
d_killpg='undef'
+d_lc_monetary_2008='undef'
d_lchown='undef'
d_ldbl_dig='undef'
d_ldexpl='undef'
diff --git a/uconfig64.sh b/uconfig64.sh
index 00fa9d069b..c575a4e064 100644
--- a/uconfig64.sh
+++ b/uconfig64.sh
@@ -247,6 +247,7 @@ d_isnanl='undef'
d_j0='undef'
d_j0l='undef'
d_killpg='undef'
+d_lc_monetary_2008='undef'
d_lchown='undef'
d_ldbl_dig='undef'
d_ldexpl='undef'
diff --git a/win32/config.ce b/win32/config.ce
index e1083afc26..37be642cab 100644
--- a/win32/config.ce
+++ b/win32/config.ce
@@ -294,6 +294,7 @@ d_isnanl='undef'
d_j0='undef'
d_j0l='undef'
d_killpg='undef'
+d_lc_monetary_2008='undef'
d_lchown='undef'
d_ldbl_dig='define'
d_ldexpl='undef'
diff --git a/win32/config.gc b/win32/config.gc
index d83ab2af7b..3451f1136f 100644
--- a/win32/config.gc
+++ b/win32/config.gc
@@ -294,6 +294,7 @@ d_isnanl='undef'
d_j0='undef'
d_j0l='undef'
d_killpg='define'
+d_lc_monetary_2008='undef'
d_lchown='undef'
d_ldbl_dig='define'
d_ldexpl='undef'
diff --git a/win32/config.vc b/win32/config.vc
index 454ff888e1..7819916fb5 100644
--- a/win32/config.vc
+++ b/win32/config.vc
@@ -294,6 +294,7 @@ d_isnanl='undef'
d_j0='undef'
d_j0l='undef'
d_killpg='define'
+d_lc_monetary_2008='undef'
d_lchown='undef'
d_ldbl_dig='define'
d_ldexpl='undef'