X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=sv.h;h=5993a8de9bc8b65722b793c3b953d5487d912d12;hb=c2267164204a961273c71c9c103831895724b0b1;hp=42a6a1bc9526f75a1511d9bc4ee0dd3cb170b3fe;hpb=a80f87c48e630b044cd5371d547b0f38e4476ec0;p=p5sagit%2Fp5-mst-13.2.git diff --git a/sv.h b/sv.h index 42a6a1b..5993a8d 100644 --- a/sv.h +++ b/sv.h @@ -246,7 +246,7 @@ struct xpvfm { CV * xcv_outside; #ifdef USE_THREADS perl_mutex *xcv_mutexp; /* protects xcv_owner */ - struct thread *xcv_owner; /* current owner thread */ + struct perl_thread *xcv_owner; /* current owner thread */ #endif /* USE_THREADS */ cv_flags_t xcv_flags; @@ -490,7 +490,14 @@ struct xpvio { #define SvTAINTED_on(sv) STMT_START{ if(tainting){sv_taint(sv);} }STMT_END #define SvTAINTED_off(sv) STMT_START{ if(tainting){sv_untaint(sv);} }STMT_END -#define SvTAINT(sv) STMT_START{ if(tainted){SvTAINTED_on(sv);} }STMT_END +#define SvTAINT(sv) \ + STMT_START { \ + if (tainting) { \ + dTHR; \ + if (tainted) \ + SvTAINTED_on(sv); \ + } \ + } STMT_END #define SvPV_force(sv, lp) sv_pvn_force(sv, &lp) #define SvPV(sv, lp) sv_pvn(sv, &lp) @@ -604,23 +611,28 @@ struct xpvio { # endif #endif /* __GNUC__ */ -/* the following macro updates any magic values this sv is associated with */ +/* the following macros update any magic values this sv is associated with */ -#define SvSETMAGIC(x) if (SvSMAGICAL(x)) mg_set(x) +#define SvGETMAGIC(x) STMT_START { if (SvGMAGICAL(x)) mg_get(x); } STMT_END +#define SvSETMAGIC(x) STMT_START { if (SvSMAGICAL(x)) mg_set(x); } STMT_END #define SvSetSV_and(dst,src,finally) \ + STMT_START { \ if ((dst) != (src)) { \ sv_setsv(dst, src); \ finally; \ - } + } \ + } STMT_END #define SvSetSV_nosteal_and(dst,src,finally) \ + STMT_START { \ if ((dst) != (src)) { \ U32 tMpF = SvFLAGS(src) & SVs_TEMP; \ SvTEMP_off(src); \ sv_setsv(dst, src); \ SvFLAGS(src) |= tMpF; \ finally; \ - } + } \ + } STMT_END #define SvSetSV(dst,src) \ SvSetSV_and(dst,src,/*nothing*/;)