1 # Copyright (C) 2001-2003, The Perl Foundation.
6 config/auto/format.pm - Sprintf Formats
10 Figures out what formats should be used for C<sprintf()>.
19 use base
qw(Parrot::Configure::Step);
21 use Parrot
::Configure
::Step
;
27 $data{description
} = q{Figuring out what formats should be used for sprintf};
33 my ( $self, $conf ) = @_;
35 _set_intvalfmt
($conf);
37 _set_floatvalfmt_nvsize
($conf);
45 my $iv = $conf->data->get(qw(iv));
50 elsif ( ( $iv eq "long" ) || ( $iv eq "long int" ) ) {
53 elsif ( ( $iv eq "long long" ) || ( $iv eq "long long int" ) ) {
57 die qq{Configure
.pl
: Can
't find a printf-style format specifier for type '$iv'\n};
59 $conf->data->set( intvalfmt => $ivformat );
62 sub _set_floatvalfmt_nvsize {
64 my ( $nv, $floatsize, $doublesize, $ldsize ) =
65 $conf->data->get(qw(nv floatsize doublesize hugefloatvalsize));
66 my ( $nvformat, $nvsize );
68 if ( $nv eq "double" ) {
69 $nvsize = $doublesize;
72 elsif ( $nv eq "long double" ) {
74 # Stay way from long double for now (it may be 64 or 80 bits)
75 # die "long double not supported at this time, use double.";
80 die qq{Configure
.pl
: Can
't find a printf-style format specifier for type '$nv'\n};
84 floatvalfmt => $nvformat,
93 # cperl-indent-level: 4
96 # vim: expandtab shiftwidth=4: