This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
VAX: catch vax floats beyond VMS or Ultrix
authorJarkko Hietaniemi <jhi@iki.fi>
Tue, 26 Jul 2016 01:50:32 +0000 (21:50 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Thu, 28 Jul 2016 02:01:01 +0000 (22:01 -0400)
t/op/sprintf.t

index 5fd9bfd..2fd91c7 100644 (file)
@@ -32,6 +32,9 @@ if ($^O eq 'VMS') {
 # No %Config.
 my $Is_Ultrix_VAX = $^O eq 'ultrix' && `uname -m` =~ /^VAX$/;
 
+# The most generic VAX catcher.
+my $Is_VAX_Float = (pack("d", 1) =~ /^[\x80\x10]\x40/);
+
 our $IS_EBCDIC = $::IS_EBCDIC;  # Solely to avoid the 'used once' warning
 our $IS_ASCII = $::IS_ASCII;   # Solely to avoid the 'used once' warning
 
@@ -51,7 +54,7 @@ while (<DATA>) {
         $data   =~ s/([eE])\-101$/${1}-56/;  # larger exponents
         $result =~ s/([eE])\-102$/${1}-57/;  #  "       "
     }
-    if ($Is_VMS_VAX || $Is_Ultrix_VAX) {
+    if ($Is_VMS_VAX || $Is_Ultrix_VAX || $Is_VAX_Float) {
        # VAX DEC C 5.3 at least since there is no
        # ccflags =~ /float=ieee/ on VAX.
        # AXP is unaffected whether or not it is using ieee.