diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-10-22 12:15:17 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-10-22 13:39:33 +0200 |
commit | 214f57503715cacf026aa04ebe516ee76b63811c (patch) | |
tree | 8a1a0ac22e6f9a23826609c2b0adb20629e5865e /cpan/ExtUtils-Constant | |
parent | 543340fb1f5a45921c194b482b7bb51f98c5722e (diff) | |
download | perl-214f57503715cacf026aa04ebe516ee76b63811c.tar.gz |
For PROXYSUBS, give the notfound struct file scope.
All others remain within the scope of the BOOT block.
Diffstat (limited to 'cpan/ExtUtils-Constant')
-rw-r--r-- | cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm b/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm index e7c9e9a7cc..3afe547b7b 100644 --- a/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm +++ b/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm @@ -371,10 +371,13 @@ EOBOOT my $struct_type = $lc_type . '_s'; my $array_name = 'values_for_' . $lc_type; $iterator{$type} = 'value_for_' . $lc_type; + # Give the notfound struct file scope. The others are scoped within the + # BOOT block + my $struct_fh = $type ? $xs_fh : $c_fh; print $c_fh "struct $struct_type $struct;\n"; - print $xs_fh <<"EOBOOT"; + print $struct_fh <<"EOBOOT"; static const struct $struct_type $array_name\[] = { @@ -391,20 +394,20 @@ EOBOOT next; } if ($item->{invert_macro}) { - print $xs_fh $self->macro_to_ifndef($macro); - print $xs_fh + print $struct_fh $self->macro_to_ifndef($macro); + print $struct_fh " /* This is the default value: */\n" if $type; } else { - print $xs_fh $ifdef; + print $struct_fh $ifdef; } - print $xs_fh " { ", join (', ', "\"$name\"", $namelen, - &$type_to_value($value)), " },\n", + print $struct_fh " { ", join (', ', "\"$name\"", $namelen, + &$type_to_value($value)), + " },\n", $self->macro_to_endif($macro); } - # Terminate the list with a NULL - print $xs_fh " { NULL, 0", (", 0" x $number_of_args), " } };\n"; + print $struct_fh " { NULL, 0", (", 0" x $number_of_args), " } };\n"; print $xs_fh <<"EOBOOT"; const struct $struct_type *$iterator{$type} = $array_name; |