summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-08-01 22:22:51 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-08-01 22:22:51 +0000
commitcf2093f6405d08be483e037b6052608c46952a75 (patch)
treea2572a825ae30eabcd1fee0cac65751bef6a4d05 /util.c
parentad7e816fc202b9506cd8e0633196331ccf37f264 (diff)
downloadperl-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.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/util.c b/util.c
index 918f37b309..45d6a6f1b6 100644
--- a/util.c
+++ b/util.c
@@ -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)