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 /util.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 'util.c')
-rw-r--r-- | util.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -1406,15 +1406,27 @@ Perl_mess(pTHX_ const char *pat, va_list *args) if (!SvCUR(sv) || *(SvEND(sv) - 1) != '\n') { dTHR; if (PL_curcop->cop_line) +#ifdef IV_IS_QUAD + Perl_sv_catpvf(aTHX_ sv, " at %_ line %" PERL_PRId64, + GvSV(PL_curcop->cop_filegv), (IV)PL_curcop->cop_line); +#else Perl_sv_catpvf(aTHX_ sv, " at %_ line %ld", GvSV(PL_curcop->cop_filegv), (long)PL_curcop->cop_line); +#endif if (GvIO(PL_last_in_gv) && IoLINES(GvIOp(PL_last_in_gv))) { bool line_mode = (RsSIMPLE(PL_rs) && SvCUR(PL_rs) == 1 && *SvPVX(PL_rs) == '\n'); +#ifdef IV_IS_QUAD + Perl_sv_catpvf(aTHX_ sv, ", <%s> %s %" PERL_PRId64, + PL_last_in_gv == PL_argvgv ? "" : GvNAME(PL_last_in_gv), + line_mode ? "line" : "chunk", + (IV)IoLINES(GvIOp(PL_last_in_gv))); +#else Perl_sv_catpvf(aTHX_ sv, ", <%s> %s %ld", PL_last_in_gv == PL_argvgv ? "" : GvNAME(PL_last_in_gv), line_mode ? "line" : "chunk", (long)IoLINES(GvIOp(PL_last_in_gv))); +#endif } #ifdef USE_THREADS if (thr->tid) |