diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 1999-08-01 22:22:51 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 1999-08-01 22:22:51 +0000 |
commit | cf2093f6405d08be483e037b6052608c46952a75 (patch) | |
tree | a2572a825ae30eabcd1fee0cac65751bef6a4d05 /pp_hot.c | |
parent | ad7e816fc202b9506cd8e0633196331ccf37f264 (diff) | |
download | perl-cf2093f6405d08be483e037b6052608c46952a75.tar.gz |
64-bit work. Now 32-bit platforms get a 100% make test
with -Duse64bits (using long long).
Tested in Solaris 2.6 sparc RH Linux 6.0 x86
(and Digital IX 4.0D, to get a true 64-bit opinion). Now e.g.
'print unpack "q", pack "q", 12345678901'
should work on such 32-bit platforms.
Still a lot of printf()s behind -D which wrongly assume
that %ld/%lx and (long) are a good combination.
Introducing a slew of new macros intended to be used in printf()
format strings: e. g. PERL_PRId64 is the string to be used
when printing an IV, printf("%" PERL_PRId64 "\n", iv).
The PRI... naming follows the C9X naming of <inttypes.h> macros.
p4raw-id: //depot/cfgperl@3861
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -589,8 +589,13 @@ PP(pp_rv2hv) if (SvTYPE(hv) == SVt_PVAV) hv = avhv_keys((AV*)hv); if (HvFILL(hv)) - Perl_sv_setpvf(aTHX_ TARG, "%ld/%ld", - (long)HvFILL(hv), (long)HvMAX(hv) + 1); +#ifdef IV_IS_QUAD + Perl_sv_setpvf(aTHX_ TARG, "%" PERL_PRId64 "/%" PERL_PRId64, + (Quad_t)HvFILL(hv), (Quad_t)HvMAX(hv) + 1); +#else + Perl_sv_setpvf(aTHX_ TARG, "%ld/%ld", + (long)HvFILL(hv), (long)HvMAX(hv) + 1); +#endif else sv_setiv(TARG, 0); |