compile on threaded perls
Lukas Mai [Fri, 22 Jun 2012 06:52:17 +0000 (08:52 +0200)]
Parameters.xs
padop_on_crack.c.inc
toke_on_crack.c.inc

index 47ad69d..c9429f0 100644 (file)
@@ -144,15 +144,15 @@ static int kw_flags(pTHX_ const char *kw_ptr, STRLEN kw_len, Spec *spec) {
 #include "toke_on_crack.c.inc"
 
 
-static void free_ptr_op(void *vp) {
+static void free_ptr_op(pTHX_ void *vp) {
        OP **pp = vp;
        op_free(*pp);
        Safefree(pp);
 }
 
-#define sv_eq_pvs(SV, S) sv_eq_pvn(SV, "" S "", sizeof (S) - 1)
+#define sv_eq_pvs(SV, S) sv_eq_pvn(aTHX_ SV, "" S "", sizeof (S) - 1)
 
-static int sv_eq_pvn(SV *sv, const char *p, STRLEN n) {
+static int sv_eq_pvn(pTHX_ SV *sv, const char *p, STRLEN n) {
        STRLEN sv_len;
        const char *sv_p = SvPV(sv, sv_len);
        return
@@ -325,7 +325,7 @@ static int parse_fun(pTHX_ OP **pop, const char *keyword_ptr, STRLEN keyword_len
                        if (!S_scan_str(aTHX_ proto, FALSE, FALSE)) {
                                croak("In %"SVf": prototype not terminated", SVfARG(declarator));
                        }
-                       S_check_prototype(declarator, proto);
+                       S_check_prototype(aTHX_ declarator, proto);
                        lex_read_space(0);
                        c = lex_peek_unichar(0);
                }
@@ -353,7 +353,7 @@ static int parse_fun(pTHX_ OP **pop, const char *keyword_ptr, STRLEN keyword_len
        /* attributes */
        Newx(attrs_sentinel, 1, OP *);
        *attrs_sentinel = NULL;
-       SAVEDESTRUCTOR(free_ptr_op, attrs_sentinel);
+       SAVEDESTRUCTOR_X(free_ptr_op, attrs_sentinel);
 
        if (c == ':' || c == '{') {
 
@@ -432,7 +432,7 @@ static int parse_fun(pTHX_ OP **pop, const char *keyword_ptr, STRLEN keyword_len
        /* munge */
        {
                /* create outer block: '{' */
-               const int save_ix = S_block_start(TRUE);
+               const int save_ix = S_block_start(aTHX_ TRUE);
                OP *init = NULL;
 
                /* my $self = shift; */
@@ -478,7 +478,7 @@ static int parse_fun(pTHX_ OP **pop, const char *keyword_ptr, STRLEN keyword_len
                body = op_append_list(OP_LINESEQ, init, body);
 
                /* close outer block: '}' */
-               S_block_end(save_ix, body);
+               S_block_end(aTHX_ save_ix, body);
        }
 
        /* it's go time. */
index f40ded3..baa2f00 100644 (file)
@@ -31,7 +31,7 @@ static int S_block_start(pTHX_ int full) {
        dVAR;
        const int retval = PL_savestack_ix;
 
-       S_pad_block_start(full);
+       S_pad_block_start(aTHX_ full);
        SAVEHINTS();
        PL_hints &= ~HINT_BLOCK_SCOPE;
        SAVECOMPILEWARNINGS();
@@ -139,13 +139,13 @@ static OP *S_scalar(pTHX_ OP *o) {
 
        switch (o->op_type) {
                case OP_REPEAT:
-                       S_scalar(cBINOPo->op_first);
+                       S_scalar(aTHX_ cBINOPo->op_first);
                        break;
                case OP_OR:
                case OP_AND:
                case OP_COND_EXPR:
                        for (kid = cUNOPo->op_first->op_sibling; kid; kid = kid->op_sibling)
-                               S_scalar(kid);
+                               S_scalar(aTHX_ kid);
                        break;
                        /* FALL THROUGH */
                case OP_SPLIT:
@@ -156,21 +156,21 @@ static OP *S_scalar(pTHX_ OP *o) {
                default:
                        if (o->op_flags & OPf_KIDS) {
                                for (kid = cUNOPo->op_first; kid; kid = kid->op_sibling)
-                                       S_scalar(kid);
+                                       S_scalar(aTHX_ kid);
                        }
                        break;
                case OP_LEAVE:
                case OP_LEAVETRY:
                        kid = cLISTOPo->op_first;
-                       S_scalar(kid);
+                       S_scalar(aTHX_ kid);
                        kid = kid->op_sibling;
 do_kids:
                        while (kid) {
                                OP *sib = kid->op_sibling;
                                if (sib && kid->op_type != OP_LEAVEWHEN)
-                                       S_scalarvoid(kid);
+                                       S_scalarvoid(aTHX_ kid);
                                else
-                                       S_scalar(kid);
+                                       S_scalar(aTHX_ kid);
                                kid = sib;
                        }
                        PL_curcop = &PL_compiling;
@@ -191,7 +191,7 @@ static OP *S_scalarkids(pTHX_ OP *o) {
     if (o && o->op_flags & OPf_KIDS) {
         OP *kid;
        for (kid = cLISTOPo->op_first; kid; kid = kid->op_sibling)
-           S_scalar(kid);
+           S_scalar(aTHX_ kid);
     }
     return o;
 }
@@ -235,7 +235,7 @@ static OP *S_scalarvoid(pTHX_ OP *o) {
                (PL_opargs[o->op_type] & OA_TARGLEX)
                /* OPp share the meaning */
        ) {
-               return S_scalar(o);                     /* As if inside SASSIGN */
+               return S_scalar(aTHX_ o);                       /* As if inside SASSIGN */
        }
 
        o->op_flags = (o->op_flags & ~OPf_WANT) | OPf_WANT_VOID;
@@ -481,7 +481,7 @@ func_ops:
                }
 
                case OP_AASSIGN: {
-                       S_inplace_aassign(o);
+                       S_inplace_aassign(aTHX_ o);
                        break;
                }
 
@@ -506,7 +506,7 @@ func_ops:
                case OP_ENTERGIVEN:
                case OP_ENTERWHEN:
                        for (kid = cUNOPo->op_first->op_sibling; kid; kid = kid->op_sibling)
-                               S_scalarvoid(kid);
+                               S_scalarvoid(aTHX_ kid);
                        break;
 
                case OP_NULL:
@@ -529,13 +529,13 @@ func_ops:
                case OP_LEAVEGIVEN:
                case OP_LEAVEWHEN:
                        for (kid = cLISTOPo->op_first; kid; kid = kid->op_sibling)
-                               S_scalarvoid(kid);
+                               S_scalarvoid(aTHX_ kid);
                        break;
                case OP_ENTEREVAL:
-                       S_scalarkids(o);
+                       S_scalarkids(aTHX_ o);
                        break;
                case OP_SCALAR:
-                       return S_scalar(o);
+                       return S_scalar(aTHX_ o);
        }
        if (useless)
                Perl_ck_warner(aTHX_ packWARN(WARN_VOID), "Useless use of %"SVf" in void context",
@@ -555,7 +555,7 @@ static OP *S_scalarseq(pTHX_ OP *o) {
                        OP *kid;
                        for (kid = cLISTOPo->op_first; kid; kid = kid->op_sibling) {
                                if (kid->op_sibling) {
-                                       S_scalarvoid(kid);
+                                       S_scalarvoid(aTHX_ kid);
                                }
                        }
                        PL_curcop = &PL_compiling;
@@ -611,7 +611,7 @@ static void S_pad_leavemy(pTHX) {
 static OP *S_block_end(pTHX_ I32 floor, OP *seq) {
        dVAR;
        const int needblockscope = PL_hints & HINT_BLOCK_SCOPE;
-       OP *retval = S_scalarseq(seq);
+       OP *retval = S_scalarseq(aTHX_ seq);
 
        CALL_BLOCK_HOOKS(bhk_pre_end, &retval);
 
@@ -619,7 +619,7 @@ static OP *S_block_end(pTHX_ I32 floor, OP *seq) {
        CopHINTS_set(&PL_compiling, PL_hints);
        if (needblockscope)
                PL_hints |= HINT_BLOCK_SCOPE; /* propagate out */
-       S_pad_leavemy();
+       S_pad_leavemy(aTHX);
 
        CALL_BLOCK_HOOKS(bhk_post_end, &retval);
 
index fca95b5..1607c78 100644 (file)
@@ -306,7 +306,7 @@ static char *S_scan_str(pTHX_ SV *sv, int keep_quoted, int keep_delims) {
        return s;
 }
 
-static void S_check_prototype(const SV *declarator, SV *proto) {
+static void S_check_prototype(pTHX_ const SV *declarator, SV *proto) {
        bool bad_proto = FALSE;
        bool in_brackets = FALSE;
        char greedy_proto = ' ';