summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-07-22 21:41:08 -0400
committerJesse Luehrs <doy@tozt.net>2013-07-22 21:41:08 -0400
commita1fc3589640dccc9c8753882dbb0c95d609b77e9 (patch)
tree6fc66604f29664da59af5d1fd65568fd93616420
parent3a9f3016c2ae17c6b714c8c2aa5a7e83c483aaa0 (diff)
downloadparse-keyword-a1fc3589640dccc9c8753882dbb0c95d609b77e9.tar.gz
parse-keyword-a1fc3589640dccc9c8753882dbb0c95d609b77e9.zip
fix compilation on threaded perls
-rw-r--r--Keyword.xs12
1 files changed, 7 insertions, 5 deletions
diff --git a/Keyword.xs b/Keyword.xs
index dd92a6a..7f70222 100644
--- a/Keyword.xs
+++ b/Keyword.xs
@@ -7,6 +7,10 @@
#define cv_clone(a) Perl_cv_clone(aTHX_ a)
#endif
+#ifndef scalar
+#define scalar(a) Perl_scalar(aTHX_ a)
+#endif
+
#define REENTER_PARSER STMT_START { \
ENTER; \
PL_curcop = &PL_compiling; \
@@ -15,7 +19,7 @@
#define LEAVE_PARSER LEAVE
-static SV *parser_fn(OP *(fn)(U32), bool named)
+static SV *parser_fn(OP *(fn)(pTHX_ U32), bool named)
{
I32 floor;
CV *code;
@@ -23,7 +27,7 @@ static SV *parser_fn(OP *(fn)(U32), bool named)
REENTER_PARSER;
floor = start_subparse(0, named ? 0 : CVf_ANON);
- code = newATTRSUB(floor, NULL, NULL, NULL, fn(0));
+ code = newATTRSUB(floor, NULL, NULL, NULL, fn(aTHX_ 0));
LEAVE_PARSER;
@@ -68,9 +72,7 @@ static OP *parser_callback(pTHX_ GV *namegv, SV *psobj, U32 *flagsp)
}
return newUNOP(OP_ENTERSUB, OPf_STACKED,
- newCVREF(0,
- Perl_scalar(newSVOP(OP_CONST, 0,
- args_generator))));
+ newCVREF(0, scalar(newSVOP(OP_CONST, 0, args_generator))));
}
/* TODO: