diff options
author | Ben Morrow <ben@morrow.me.uk> | 2009-01-18 08:35:23 +0000 |
---|---|---|
committer | Ben Morrow <ben@morrow.me.uk> | 2009-03-25 21:14:03 +0000 |
commit | 180b7b9bf7b919003df56bf402fc3934dc71f196 (patch) | |
tree | 43f2aa2c75a25fde4dcbc1d4ec0fb28334a48c0a /pp.h | |
parent | d3ebc3eb19094f82ef837b098bec51ec3d68e893 (diff) | |
download | perl-180b7b9bf7b919003df56bf402fc3934dc71f196.tar.gz |
Move magic logic into tryAMAGICftest macro.
Diffstat (limited to 'pp.h')
-rw-r--r-- | pp.h | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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)) \ |