summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-07-19 16:26:34 -0600
committerKarl Williamson <khw@cpan.org>2018-07-19 16:28:06 -0600
commitcb57a253c69fe8de1944b420abb61efdc241bbad (patch)
treedad9e6b63f9539c802a2496a27ba5ac202d50acd /ext
parent3b8ffc90f45719aac51ef6e57afea6a501731a5a (diff)
downloadperl-cb57a253c69fe8de1944b420abb61efdc241bbad.tar.gz
Revert "Remove some deprecated functions from mathoms.c"
This reverts commit e6e9f5a198d7e054e6857a9c6e99a07d639f7f3c. I think it best to revert this until I'm ready for stating in perldelta exactly the options for replacing uses of these functions.
Diffstat (limited to 'ext')
-rw-r--r--ext/XS-APItest/APItest.pm2
-rw-r--r--ext/XS-APItest/APItest.xs16
-rw-r--r--ext/XS-APItest/t/handy_base.pl6
3 files changed, 19 insertions, 5 deletions
diff --git a/ext/XS-APItest/APItest.pm b/ext/XS-APItest/APItest.pm
index ba76d8f4da..61531fc97a 100644
--- a/ext/XS-APItest/APItest.pm
+++ b/ext/XS-APItest/APItest.pm
@@ -5,7 +5,7 @@ use strict;
use warnings;
use Carp;
-our $VERSION = '1.00';
+our $VERSION = '0.99';
require XSLoader;
diff --git a/ext/XS-APItest/APItest.xs b/ext/XS-APItest/APItest.xs
index 76c2ef5d33..a30659f14f 100644
--- a/ext/XS-APItest/APItest.xs
+++ b/ext/XS-APItest/APItest.xs
@@ -6434,9 +6434,11 @@ test_toLOWER_utf8(SV * p, int type)
else if (type == -1) {
resultant_cp = toLOWER_utf8(input, s, &len);
}
+#ifndef NO_MATHOMS
else {
- croak("fail: Unexpected type=%d", type);
+ resultant_cp = Perl_to_utf8_lower(aTHX_ input, s, &len);
}
+#endif
av_push(av, newSVuv(resultant_cp));
utf8 = newSVpvn((char *) s, len);
@@ -6522,9 +6524,11 @@ test_toFOLD_utf8(SV * p, int type)
else if (type == -1) {
resultant_cp = toFOLD_utf8(input, s, &len);
}
+#ifndef NO_MATHOMS
else {
- croak("fail: Unexpected type=%d", type);
+ resultant_cp = Perl_to_utf8_fold(aTHX_ input, s, &len);
}
+#endif
av_push(av, newSVuv(resultant_cp));
utf8 = newSVpvn((char *) s, len);
@@ -6610,9 +6614,11 @@ test_toUPPER_utf8(SV * p, int type)
else if (type == -1) {
resultant_cp = toUPPER_utf8(input, s, &len);
}
+#ifndef NO_MATHOMS
else {
- croak("fail: Unexpected type=%d", type);
+ resultant_cp = Perl_to_utf8_upper(aTHX_ input, s, &len);
}
+#endif
av_push(av, newSVuv(resultant_cp));
utf8 = newSVpvn((char *) s, len);
@@ -6691,9 +6697,11 @@ test_toTITLE_utf8(SV * p, int type)
else if (type == -1) {
resultant_cp = toTITLE_utf8(input, s, &len);
}
+#ifndef NO_MATHOMS
else {
- croak("fail: Unexpected type=%d", type);
+ resultant_cp = Perl_to_utf8_title(aTHX_ input, s, &len);
}
+#endif
av_push(av, newSVuv(resultant_cp));
utf8 = newSVpvn((char *) s, len);
diff --git a/ext/XS-APItest/t/handy_base.pl b/ext/XS-APItest/t/handy_base.pl
index 9143eabfe0..7e8194e643 100644
--- a/ext/XS-APItest/t/handy_base.pl
+++ b/ext/XS-APItest/t/handy_base.pl
@@ -163,6 +163,7 @@ my %utf8_param_code = (
"_safe" => 0,
"_safe, malformed" => 1,
"deprecated unsafe" => -1,
+ "deprecated mathoms" => -2,
);
# This test is split into this number of files.
@@ -555,8 +556,13 @@ foreach my $name (sort keys %to_properties) {
foreach my $utf8_param("_safe",
"_safe, malformed",
"deprecated unsafe",
+ "deprecated mathoms",
)
{
+ use Config;
+ next if $utf8_param eq 'deprecated mathoms'
+ && $Config{'ccflags'} =~ /-DNO_MATHOMS/;
+
my $utf8_param_code = $utf8_param_code{$utf8_param};
my $expect_error = $utf8_param_code > 0;