This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
opcode.h: Restrict scope of internal variables to core
authorKarl Williamson <khw@cpan.org>
Sat, 17 Oct 2020 13:18:16 +0000 (07:18 -0600)
committerKarl Williamson <khw@cpan.org>
Sun, 29 Nov 2020 16:10:08 +0000 (09:10 -0700)
opcode.h
regen/opcode.pl

index c754a64..7c708e4 100644 (file)
--- a/opcode.h
+++ b/opcode.h
@@ -13,6 +13,8 @@
  * Any changes made here will be lost!
  */
 
+#if defined(PERL_CORE) || defined(PERL_EXT)
+
 #define Perl_pp_scalar Perl_pp_null
 #define Perl_pp_padany Perl_unimplemented_op
 #define Perl_pp_regcmaybe Perl_pp_null
 #define Perl_pp_sgrent Perl_pp_ehostent
 #define Perl_pp_egrent Perl_pp_ehostent
 #define Perl_pp_custom Perl_unimplemented_op
+
+#endif /* End of if defined(PERL_CORE) || defined(PERL_EXT) */
+
 START_EXTERN_C
 
 #ifndef DOINIT
index cbd2979..df66201 100755 (executable)
@@ -17,6 +17,7 @@
 # This script is normally invoked from regen.pl.
 
 use strict;
+my $restrict_to_core = "if defined(PERL_CORE) || defined(PERL_EXT)";
 
 BEGIN {
     # Get function prototypes
@@ -917,6 +918,7 @@ require './regen/op_private';
 #use Data::Dumper;
 #print Dumper \%LABELS, \%DEFINES, \%FLAGS, \%BITFIELDS;
 
+print $oc "#$restrict_to_core\n\n";
 
 # Emit defines.
 
@@ -954,6 +956,7 @@ require './regen/op_private';
     # If the last op was conditional, we need to close it out:
     unimplemented();
 }
+print $oc "\n#endif /* End of $restrict_to_core */\n\n";
 
 print $on "typedef enum opcode {\n";