Skip to content

Commit ac677ca

Browse files
committed
remove usage of obsolete OutCopFILE macro
OutCopFILE was added in commit 248c2a4 in 5.7.2, and became obsolete in commit e37778c in 5.11.0. To allow future commits to use more varieties of CopFILE* macros around core, remove core usage of OutCopFILE. OutCopFILE can't be outright removed as CPAN grep shows some usage without a #ifndef OutCopFILE fallback.
1 parent 1b1d43b commit ac677ca

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

cop.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,8 @@ be zero.
535535
#define CopLINE_dec(c) (--CopLINE(c))
536536
#define CopLINE_set(c,l) (CopLINE(c) = (l))
537537

538-
/* OutCopFILE() is CopFILE for output (caller, die, warn, etc.) */
538+
/* This macro was used on Classic MacOS to pretty print the path for
539+
caller, die, warn, etc, but now is a noop on all platforms */
539540
#define OutCopFILE(c) CopFILE(c)
540541

541542
#define CopHINTS_get(c) ((c)->cop_hints + 0)

deb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void
5959
Perl_vdeb(pTHX_ const char *pat, va_list *args)
6060
{
6161
#ifdef DEBUGGING
62-
const char* const file = PL_curcop ? OutCopFILE(PL_curcop) : "<null>";
62+
const char* const file = PL_curcop ? CopFILE(PL_curcop) : "<null>";
6363
const char* const display_file = file ? file : "<free>";
6464
const long line = PL_curcop ? (long)CopLINE(PL_curcop) : 0;
6565

pp_ctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1847,7 +1847,7 @@ PP(pp_caller)
18471847
sv_sethek(TARG, stash_hek);
18481848
PUSHTARG;
18491849
}
1850-
mPUSHs(newSVpv(OutCopFILE(cx->blk_oldcop), 0));
1850+
mPUSHs(newSVpv(CopFILE(cx->blk_oldcop), 0));
18511851
lcop = closest_cop(cx->blk_oldcop, OpSIBLING(cx->blk_oldcop),
18521852
cx->blk_sub.retop, TRUE);
18531853
if (!lcop)

toke.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11099,7 +11099,7 @@ Perl_yyerror_pvn(pTHX_ const char *const s, STRLEN len, U32 flags)
1109911099
}
1110011100
msg = newSVpvn_flags(s, len, (flags & SVf_UTF8) | SVs_TEMP);
1110111101
Perl_sv_catpvf(aTHX_ msg, " at %s line %"IVdf", ",
11102-
OutCopFILE(PL_curcop),
11102+
CopFILE(PL_curcop),
1110311103
(IV)(PL_parser->preambling == NOLINE
1110411104
? CopLINE(PL_curcop)
1110511105
: PL_parser->preambling));
@@ -11124,10 +11124,10 @@ Perl_yyerror_pvn(pTHX_ const char *const s, STRLEN len, U32 flags)
1112411124
SV * errsv;
1112511125
if (PL_in_eval && ((errsv = ERRSV), SvCUR(errsv)))
1112611126
Perl_croak(aTHX_ "%"SVf"%s has too many errors.\n",
11127-
SVfARG(errsv), OutCopFILE(PL_curcop));
11127+
SVfARG(errsv), CopFILE(PL_curcop));
1112811128
else
1112911129
Perl_croak(aTHX_ "%s has too many errors.\n",
11130-
OutCopFILE(PL_curcop));
11130+
CopFILE(PL_curcop));
1113111131
}
1113211132
PL_in_my = 0;
1113311133
PL_in_my_stash = NULL;

util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ Perl_mess_sv(pTHX_ SV *basemsg, bool consume)
14781478

14791479
if (CopLINE(cop))
14801480
Perl_sv_catpvf(aTHX_ sv, " at %s line %"IVdf,
1481-
OutCopFILE(cop), (IV)CopLINE(cop));
1481+
CopFILE(cop), (IV)CopLINE(cop));
14821482
/* Seems that GvIO() can be untrustworthy during global destruction. */
14831483
if (GvIO(PL_last_in_gv) && (SvTYPE(GvIOp(PL_last_in_gv)) == SVt_PVIO)
14841484
&& IoLINES(GvIOp(PL_last_in_gv)))

0 commit comments

Comments
 (0)