cvsuser 01/12/31 19:14:13
Modified: . Configure.pl
Log:
Quad updates.
Courtesy of Nicholas Clark <[EMAIL PROTECTED]>
Revision Changes Path
1.59 +25 -6 parrot/Configure.pl
Index: Configure.pl
===================================================================
RCS file: /home/perlcvs/parrot/Configure.pl,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -w -r1.58 -r1.59
--- Configure.pl 31 Dec 2001 21:58:15 -0000 1.58
+++ Configure.pl 1 Jan 2002 03:14:13 -0000 1.59
@@ -2,7 +2,7 @@
#
# Configure.pl
#
-# $Id: Configure.pl,v 1.58 2001/12/31 21:58:15 dan Exp $
+# $Id: Configure.pl,v 1.59 2002/01/01 03:14:13 dan Exp $
#
# Author: Brent Dax
#
@@ -42,7 +42,7 @@
if($opt_version) {
print "Parrot Version $parrot_version Configure\n";
- print '$Id: Configure.pl,v 1.58 2001/12/31 21:58:15 dan Exp $' . "\n";
+ print '$Id: Configure.pl,v 1.59 2002/01/01 03:14:13 dan Exp $' . "\n";
exit;
}
@@ -395,15 +395,34 @@
foreach ('intvalsize', 'opcode_t_size') {
my $which = $_ eq 'intvalsize' ? 'packtype_i' : 'packtype_op';
+ my $format;
if (($] >= 5.006) && ($c{$_} == $c{longsize}) ) {
- $c{$which} = 'l!';
+ $format = 'l!';
}
elsif ($c{$_} == 4) {
- $c{$which} = 'l';
+ $format = 'l';
}
- else {
- die "Configure.pl: Unable to find a suitable packtype for $_.\n";
+ elsif ($c{$_} == 8 and $Config{quadtype}) {
+ # pp_pack is annoying, and this won't work unless sizeof(UV) >= 8
+ $format = 'q';
+ }
+ die "Configure.pl: Unable to find a suitable packtype for $_.\n"
+ unless $format;
+
+ my $test = eval {pack $format, 0};
+ unless (defined $test) {
+ die <<"AARGH"
+Configure.pl: Unable to find a functional packtype for $_.
+ '$format' failed: $@
+AARGH
+ }
+ unless (length $test == $c{$_}) {
+ die sprintf <<"AARGH", $c{$_}, length $test;
+Configure.pl: Unable to find a functional packtype for $_.
+ Need a format for %d bytes, but '$format' gave %d bytes.
+AARGH
}
+ $c{$which} = $format;
}
$c{packtype_n} = 'd';