This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In embed.pl, inline hide() and bincompat_var() into their only call point.
authorNicholas Clark <nick@ccl4.org>
Sun, 7 Aug 2011 14:16:00 +0000 (16:16 +0200)
committerNicholas Clark <nick@ccl4.org>
Sun, 7 Aug 2011 14:16:00 +0000 (16:16 +0200)
hide() has only been used by bincompat_var() since commit acfe0abcedaf592f
in 2001, and bincompat_var() only used in one place at the top level since
commit 87b9e16005b9e39b in 2010.

regen/embed.pl

index fa9c168..232af36 100755 (executable)
@@ -380,11 +380,6 @@ sub readvars {
 my @intrp = readvars 'intrpvar.h','I';
 my @globvar = readvars 'perlvars.h','G';
 
-sub undefine ($) {
-    my ($sym) = @_;
-    "#undef  $sym\n";
-}
-
 sub hide {
     my ($from, $to, $indent) = @_;
     $indent = '' unless defined $indent;
@@ -392,12 +387,6 @@ sub hide {
     "#${indent}define $from" . "\t" x ($t < 3 ? 3 - $t : 1) . "$to\n";
 }
 
-sub bincompat_var ($$) {
-    my ($pfx, $sym) = @_;
-    my $arg = ($pfx eq 'G' ? 'NULL' : 'aTHX');
-    undefine("PL_$sym") . hide("PL_$sym", "(*Perl_${pfx}${sym}_ptr($arg))");
-}
-
 sub multon ($$$) {
     my ($sym,$pre,$ptr) = @_;
     hide("PL_$sym", "($ptr$pre$sym)");
@@ -741,7 +730,8 @@ END_EXTERN_C
 EOT
 
 foreach $sym (@globvar) {
-    print $capih bincompat_var('G',$sym);
+    print $capih
+       "#undef  PL_$sym\n" . hide("PL_$sym", "(*Perl_G${sym}_ptr(NULL))");
 }
 
 print $capih <<'EOT';