Change 13414 by jhi@alpha on 2001/12/01 20:30:17
Try to make a missing RADIXCHAR a softer kinder error.
Affected files ...
.... //depot/perl/ext/I18N/Langinfo/Langinfo.t#8 edit
Differences ...
==== //depot/perl/ext/I18N/Langinfo/Langinfo.t#8 (text) ====
Index: perl/ext/I18N/Langinfo/Langinfo.t
--- perl/ext/I18N/Langinfo/Langinfo.t.~1~ Sat Dec 1 13:45:06 2001
+++ perl/ext/I18N/Langinfo/Langinfo.t Sat Dec 1 13:45:06 2001
@@ -12,11 +12,17 @@
}
}
-use I18N::Langinfo qw(langinfo ABDAY_1 DAY_1 ABMON_1 MON_1 RADIXCHAR);
+use I18N::Langinfo qw(langinfo ABDAY_1 DAY_1 ABMON_1 MON_1);
use POSIX qw(setlocale LC_ALL);
use Config;
-setlocale(LC_ALL, "C");
+print "# ABDAY_1 = ", ABDAY_1, "\n";
+
+eval { I18N::Langinfo->import('RADIXCHAR') }; # silly glibcs
+print "# RADIXCHAR = ", RADIXCHAR(), " (eval error = '$@')\n";
+my $has_RADIXCHAR = !$@;
+
+setlocale(LC_ALL, $ENV{LC_ALL} = $ENV{LANG} = "C");
print "1..5\n";
@@ -32,20 +38,33 @@
print "not " unless langinfo(MON_1) eq "January";
print "ok 4\n";
-unless (eval { langinfo(RADIXCHAR) } eq ".") {
- print "not ok 5 - RADIXCHAR undefined\n";
+my $RADIXCHAR_ok;
+
+if ($has_RADIXCHAR) {
+ unless (langinfo(RADIXCHAR()) eq ".") {
+ print "not ok 5 - RADIXCHAR not '.' under the C locale\n";
+ } else {
+ print "ok 5\n";
+ $RADIXCHAR_ok = 1;
+ }
+} else {
+ print "ok 5 # Skip: you do not have RADIXHCAR\n";
+}
+
+unless ($RADIXCHAR_ok) {
if ($Config{d_gnulibc} || $Config{cppsymbols} =~ /__GNU_LIBRARY_/) {
print <<EOM;
#
# You are probably using GNU libc. The RADIXCHAR not getting defined
-# by I18N::Langinfo is a known problem in some older versions of the
+# by I18N::Langinfo is a known problem in some versions of the
# GNU libc (caused by the combination of using only enums, not cpp
# definitions, and of hiding the definitions behind rather obscure
# feature tests). Upgrading your libc is strongly suggested.
#
EOM
}
-} else {
- print "ok 5\n";
}
+
+
+
End of Patch.