[svn:parrot] r36495 - trunk/config/auto

Infinoid at svn.parrot.org Infinoid at svn.parrot.org
Mon Feb 9 17:04:13 UTC 2009


Author: Infinoid
Date: Mon Feb  9 17:04:13 2009
New Revision: 36495
URL: https://trac.parrot.org/parrot/changeset/36495

Log:
Apply patch from doughera++ in TT #294.
[config] Use "long double" printf format from perl5 config; "%.15Lg" isn't
always correct.

Modified:
   trunk/config/auto/format.pm

Modified: trunk/config/auto/format.pm
==============================================================================
--- trunk/config/auto/format.pm	Mon Feb  9 16:44:46 2009	(r36494)
+++ trunk/config/auto/format.pm	Mon Feb  9 17:04:13 2009	(r36495)
@@ -15,6 +15,7 @@
 
 use strict;
 use warnings;
+use Config;  # for long double printf format
 
 use base qw(Parrot::Configure::Step);
 
@@ -115,7 +116,13 @@
         # Stay way from long double for now (it may be 64 or 80 bits)
         # die "long double not supported at this time, use double.";
         $nvsize   = $ldsize;
-        $nvformat = "%Lf";
+        if (defined($Config{'sPRIgldbl'})) {
+            $nvformat = "%.15" .  $Config{'sPRIgldbl'};
+            $nvformat =~ s/"//g;   # Perl 5's Config value has embedded double quotes
+        }
+        else {
+            die qq{Configure.pl:  Can't find a printf-style format specifier for type '$nv'\n};
+        }
     }
     else {
         die qq{Configure.pl:  Can't find a printf-style format specifier for type '$nv'\n};


More information about the parrot-commits mailing list