[Bast-commits] r4866 - in Devel-Declare/1.000/branches/hook_op_check: . lib/Devel

rafl at dev.catalyst.perl.org rafl at dev.catalyst.perl.org
Wed Oct 1 10:50:25 BST 2008


Author: rafl
Date: 2008-10-01 10:50:25 +0100 (Wed, 01 Oct 2008)
New Revision: 4866

Modified:
   Devel-Declare/1.000/branches/hook_op_check/Declare.xs
   Devel-Declare/1.000/branches/hook_op_check/Makefile.PL
   Devel-Declare/1.000/branches/hook_op_check/lib/Devel/Declare.pm
Log:
Use B::Hooks::OP::Check to register PL_check callbacks.

Modified: Devel-Declare/1.000/branches/hook_op_check/Declare.xs
===================================================================
--- Devel-Declare/1.000/branches/hook_op_check/Declare.xs	2008-10-01 09:45:08 UTC (rev 4865)
+++ Devel-Declare/1.000/branches/hook_op_check/Declare.xs	2008-10-01 09:50:25 UTC (rev 4866)
@@ -3,6 +3,7 @@
 #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>
@@ -192,15 +193,11 @@
 
 /* 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
@@ -251,8 +248,6 @@
   return o;
 }
 
-STATIC OP *(*dd_old_ck_entereval)(pTHX_ OP *op);
-
 OP* dd_pp_entereval(pTHX) {
   dSP;
   dPOPss;
@@ -278,7 +273,6 @@
 }
 
 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;
@@ -292,15 +286,11 @@
   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 */
 
@@ -333,12 +323,9 @@
 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);
 

Modified: Devel-Declare/1.000/branches/hook_op_check/Makefile.PL
===================================================================
--- Devel-Declare/1.000/branches/hook_op_check/Makefile.PL	2008-10-01 09:45:08 UTC (rev 4865)
+++ Devel-Declare/1.000/branches/hook_op_check/Makefile.PL	2008-10-01 09:50:25 UTC (rev 4866)
@@ -2,19 +2,27 @@
 
 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,
 );

Modified: Devel-Declare/1.000/branches/hook_op_check/lib/Devel/Declare.pm
===================================================================
--- Devel-Declare/1.000/branches/hook_op_check/lib/Devel/Declare.pm	2008-10-01 09:45:08 UTC (rev 4865)
+++ Devel-Declare/1.000/branches/hook_op_check/lib/Devel/Declare.pm	2008-10-01 09:50:25 UTC (rev 4866)
@@ -14,6 +14,7 @@
 use vars qw(%declarators %declarator_handlers @ISA);
 use base qw(DynaLoader);
 use Scalar::Util 'set_prototype';
+use B::Hooks::OP::Check;
 
 bootstrap Devel::Declare;
 




More information about the Bast-commits mailing list