#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
+#include "hook_op_check.h"
#undef printf
#include "stolen_chunk_of_toke.c"
#include <stdio.h>
/* replacement PL_check rv2cv entry */
-STATIC OP *(*dd_old_ck_rv2cv)(pTHX_ OP *op);
-
STATIC OP *dd_ck_rv2cv(pTHX_ OP *o) {
OP* kid;
int dd_flags;
char* cb_args[6];
- o = dd_old_ck_rv2cv(aTHX_ o); /* let the original do its job */
-
if (in_declare) {
cb_args[0] = NULL;
#ifdef DD_DEBUG
return o;
}
-STATIC OP *(*dd_old_ck_entereval)(pTHX_ OP *op);
-
OP* dd_pp_entereval(pTHX) {
dSP;
dPOPss;
}
STATIC OP *dd_ck_entereval(pTHX_ OP *o) {
- o = dd_old_ck_entereval(aTHX_ o); /* let the original do its job */
if (o->op_ppaddr == PL_ppaddr[OP_ENTEREVAL])
o->op_ppaddr = dd_pp_entereval;
return o;
return count;
}
-STATIC OP *(*dd_old_ck_const)(pTHX_ OP*op);
-
STATIC OP *dd_ck_const(pTHX_ OP *o) {
int dd_flags;
char* s;
char* name;
- o = dd_old_ck_const(aTHX_ o); /* let the original do its job */
-
/* if this is set, we just grabbed a delimited string or something,
not a bareword, so NO TOUCHY */
setup()
CODE:
if (!initialized++) {
- dd_old_ck_rv2cv = PL_check[OP_RV2CV];
- PL_check[OP_RV2CV] = dd_ck_rv2cv;
- dd_old_ck_entereval = PL_check[OP_ENTEREVAL];
- PL_check[OP_ENTEREVAL] = dd_ck_entereval;
- dd_old_ck_const = PL_check[OP_CONST];
- PL_check[OP_CONST] = dd_ck_const;
+ hook_op_check(OP_RV2CV, dd_ck_rv2cv);
+ hook_op_check(OP_ENTEREVAL, dd_ck_entereval);
+ hook_op_check(OP_CONST, dd_ck_const);
}
filter_add(dd_filter_realloc, NULL);
use 5.008001;
+use ExtUtils::Depends;
+
name 'Devel-Declare';
all_from 'lib/Devel/Declare.pm';
requires 'Scalar::Util';
+requires 'B::Hooks::OP::Check';
build_requires 'Test::More';
build_requires 'Scope::Guard';
+configure_requires 'ExtUtils::Depends';
+configure_requires 'B::Hooks::OP::Check';
postamble(<<'EOM');
$(OBJECT) : stolen_chunk_of_toke.c
EOM
+my $pkg = ExtUtils::Depends->new('Devel::Declare', 'B::Hooks::OP::Check');
+
WriteMakefile(
dist => {
PREOP => 'pod2text lib/Devel/Declare.pm >$(DISTVNAME)/README'
- }
+ },
+ $pkg->get_makefile_vars,
);