diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-11-05 12:57:40 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-11-05 12:57:40 +0000 |
commit | eb87d5ef4f3abe7f9c4c2c1f62f9acb7cae8b335 (patch) | |
tree | 4fede618762f8ec6dec65948a9f4cc510981490e /pp.h | |
parent | b311af6269bf99f73d9dd17d28dfefaec9fc7ec4 (diff) | |
download | perl-eb87d5ef4f3abe7f9c4c2c1f62f9acb7cae8b335.tar.gz |
Allow passing of the full enum name into the tryAMAGICbin family of
macros, to avoid needing C pre-processor string concatenation within
the lowest level expansion.
p4raw-id: //depot/perl@26015
Diffstat (limited to 'pp.h')
-rw-r--r-- | pp.h | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -397,23 +397,29 @@ and C<PUSHu>. #define AMGf_assign 4 #define AMGf_unary 8 -#define tryAMAGICbinW(meth,assign,set) STMT_START { \ +#define tryAMAGICbinW_var(meth_enum,assign,set) STMT_START { \ if (PL_amagic_generation) { \ SV* tmpsv; \ SV* const right= *(sp); SV* const left= *(sp-1);\ if ((SvAMAGIC(left)||SvAMAGIC(right))&&\ (tmpsv=amagic_call(left, \ right, \ - CAT2(meth,_amg), \ + meth_enum, \ (assign)? AMGf_assign: 0))) {\ SPAGAIN; \ (void)POPs; set(tmpsv); RETURN; } \ } \ } STMT_END +#define tryAMAGICbinW(meth,assign,set) \ + tryAMAGICbinW_var(CAT2(meth,_amg),assign,set) + #define tryAMAGICbin(meth,assign) tryAMAGICbinW(meth,assign,SETsv) #define tryAMAGICbinSET(meth,assign) tryAMAGICbinW(meth,assign,SETs) +#define tryAMAGICbinSET_var(meth_enum,assign) \ + tryAMAGICbinW_var(meth_enum,assign,SETs) + #define AMG_CALLun(sv,meth) amagic_call(sv,&PL_sv_undef, \ CAT2(meth,_amg),AMGf_noright | AMGf_unary) #define AMG_CALLbinL(left,right,meth) \ |