summaryrefslogtreecommitdiff
path: root/pp.h
diff options
context:
space:
mode:
authorBen Morrow <ben@morrow.me.uk>2009-01-18 08:35:23 +0000
committerBen Morrow <ben@morrow.me.uk>2009-03-25 21:14:03 +0000
commit180b7b9bf7b919003df56bf402fc3934dc71f196 (patch)
tree43f2aa2c75a25fde4dcbc1d4ec0fb28334a48c0a /pp.h
parentd3ebc3eb19094f82ef837b098bec51ec3d68e893 (diff)
downloadperl-180b7b9bf7b919003df56bf402fc3934dc71f196.tar.gz
Move magic logic into tryAMAGICftest macro.
Diffstat (limited to 'pp.h')
-rw-r--r--pp.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/pp.h b/pp.h
index 118c027201..5c25b5513b 100644
--- a/pp.h
+++ b/pp.h
@@ -471,6 +471,22 @@ Does not use C<TARG>. See also C<XPUSHu>, C<mPUSHu> and C<PUSHu>.
#define tryAMAGICunDEREF_var(meth_enum) \
tryAMAGICunW_var(meth_enum,setAGAIN,0,(void)0)
+#define tryAMAGICftest(chr) \
+ STMT_START { \
+ if (SvAMAGIC(TOPs)) { \
+ SV * const tmpsv = amagic_call(TOPs, \
+ newSVpvn_flags(&chr, 1, SVs_TEMP), \
+ ftest_amg, 0); \
+ \
+ if (tmpsv) { \
+ SPAGAIN; \
+ SETs(tmpsv); \
+ RETURN; \
+ } \
+ } \
+ } STMT_END
+
+
#define opASSIGN (PL_op->op_flags & OPf_STACKED)
#define SETsv(sv) STMT_START { \
if (opASSIGN || (SvFLAGS(TARG) & SVs_PADMY)) \