summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2017-09-03 11:12:11 -0700
committerFather Chrysostomos <sprout@cpan.org>2017-10-08 13:02:03 -0700
commitf5b4df4d4bd28d083b2621ed5266a9fb57507d0e (patch)
tree9c9704a799b84f49d2049d1aeaa98be316f7c2c1 /sv.h
parent738f9dbfd2c2579147ef1010c651a0baeca1e5d4 (diff)
downloadperl-f5b4df4d4bd28d083b2621ed5266a9fb57507d0e.tar.gz
Add isGV_or_RVCV macro
This will be useful for a few code paths that need to treat a sub ref in a stash the same way as a GV.
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sv.h b/sv.h
index a31bd73a52..0fdb8c84bf 100644
--- a/sv.h
+++ b/sv.h
@@ -2146,6 +2146,10 @@ See also C<L</PL_sv_yes>> and C<L</PL_sv_no>>.
assert (!SvIOKp(sv)); \
(SvFLAGS(sv) &= ~SVpgv_GP); \
} STMT_END
+#ifdef PERL_CORE
+# define isGV_or_RVCV(kadawp) \
+ (isGV(kadawp) || (SvROK(kadawp) && SvTYPE(SvRV(kadawp)) == SVt_PVCV))
+#endif
#define isREGEXP(sv) \
(SvTYPE(sv) == SVt_REGEXP \
|| (SvFLAGS(sv) & (SVTYPEMASK|SVpgv_GP|SVf_FAKE)) \