This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove the conditional #define of OPpPAD_STATE from the BOOT block in B.xs
authorNicholas Clark <nick@ccl4.org>
Sun, 31 Oct 2010 09:43:15 +0000 (09:43 +0000)
committerNicholas Clark <nick@ccl4.org>
Sun, 31 Oct 2010 09:43:15 +0000 (09:43 +0000)
This can now be done with less code in the Makefile.PL since commit
b1826b71659a2c08 changed B to use ExtUtils::Constant

ext/B/B.xs
ext/B/Makefile.PL

index 872d399..16c6179 100644 (file)
@@ -605,9 +605,6 @@ BOOT:
     specialsv_list[4] = (SV *) pWARN_ALL;
     specialsv_list[5] = (SV *) pWARN_NONE;
     specialsv_list[6] = (SV *) pWARN_STD;
-#if PERL_VERSION <= 8
-#  define OPpPAD_STATE 0
-#endif
 }
 
 #define B_main_cv()    PL_main_cv
index d026a71..f3d59ac 100644 (file)
@@ -36,7 +36,7 @@ if ($] >= 5.009) {
     push @names, 'AVf_REAL';
     # This is only present in 5.10, but it's useful to B::Deparse to be able
     # to import a dummy value from B
-    push @names, 'OPpPAD_STATE';
+    push @names, {name=>"OPpPAD_STATE", default=>["IV", "0"]};
 }  
 
 if ($] < 5.011) {
@@ -71,6 +71,6 @@ foreach my $tuple (['op_reg_common.h','(?:(?:RXf_)?PMf_)'],
 WriteConstants(
     PROXYSUBS => {push => 'EXPORT_OK'},
     NAME => 'B',
-    NAMES => [map {{name=>$_, macro=>1}} @names],
+    NAMES => [map {ref $_ ? $_ : {name=>$_, macro=>1}} @names],
     XS_SUBNAME => undef,
 );