Move PL_runops_{std,dbg} to perl.h, and make them const.
authorNicholas Clark <nick@ccl4.org>
Mon, 2 May 2011 14:02:57 +0000 (15:02 +0100)
committerNicholas Clark <nick@ccl4.org>
Sun, 12 Jun 2011 14:15:22 +0000 (16:15 +0200)
They exist solely to ensure that Perl_runops_standard and Perl_runops_debug
are linked in - nothing assigns to either variable, and nothing reads them.

embedvar.h
globvar.sym
perl.h
perlapi.h
perlvars.h

index 296a3b4..a540fd6 100644 (file)
 #define PL_Gperlio_mutex       (my_vars->Gperlio_mutex)
 #define PL_ppaddr              (my_vars->Gppaddr)
 #define PL_Gppaddr             (my_vars->Gppaddr)
-#define PL_runops_dbg          (my_vars->Grunops_dbg)
-#define PL_Grunops_dbg         (my_vars->Grunops_dbg)
-#define PL_runops_std          (my_vars->Grunops_std)
-#define PL_Grunops_std         (my_vars->Grunops_std)
 #ifdef OS2
 #define PL_sh_path             (my_vars->Gsh_path)
 #define PL_Gsh_path            (my_vars->Gsh_path)
 #define PL_Gperlio_fd_refcnt_size      PL_perlio_fd_refcnt_size
 #define PL_Gperlio_mutex       PL_perlio_mutex
 #define PL_Gppaddr             PL_ppaddr
-#define PL_Grunops_dbg         PL_runops_dbg
-#define PL_Grunops_std         PL_runops_std
 #ifdef OS2
 #define PL_Gsh_path            PL_sh_path
 #endif
index 81472f6..b6a36de 100644 (file)
@@ -45,6 +45,8 @@ regkind
 reg_name
 reg_extflags_name
 revision
+runops_dbg
+runops_std
 sig_name
 sig_num
 simple
diff --git a/perl.h b/perl.h
index fa86c7f..b96cdcd 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -5049,6 +5049,14 @@ END_EXTERN_C
 
 START_EXTERN_C
 
+/* dummy variables that hold pointers to both runops functions, thus forcing
+ * them *both* to get linked in (useful for Peek.xs, debugging etc) */
+
+EXTCONST runops_proc_t PL_runops_std
+  INIT(Perl_runops_standard);
+EXTCONST runops_proc_t PL_runops_dbg
+  INIT(Perl_runops_debug);
+
 /* PERL_GLOBAL_STRUCT_PRIVATE wants to keep global data like the
  * magic vtables const, but this is incompatible with SWIG which
  * does want to modify the vtables. */
index 9a82b18..a48abed 100644 (file)
--- a/perlapi.h
+++ b/perlapi.h
@@ -141,10 +141,6 @@ END_EXTERN_C
 #define PL_perlio_mutex                (*Perl_Gperlio_mutex_ptr(NULL))
 #undef  PL_ppaddr
 #define PL_ppaddr              (*Perl_Gppaddr_ptr(NULL))
-#undef  PL_runops_dbg
-#define PL_runops_dbg          (*Perl_Grunops_dbg_ptr(NULL))
-#undef  PL_runops_std
-#define PL_runops_std          (*Perl_Grunops_std_ptr(NULL))
 #undef  PL_sh_path
 #define PL_sh_path             (*Perl_Gsh_path_ptr(NULL))
 #undef  PL_sig_defaulting
index bf298c0..8ee418f 100644 (file)
@@ -139,12 +139,6 @@ PERLVAR(Gperlio_mutex, perl_mutex)    /* Mutex for perlio fd refcounts */
  * can be set atomically (ie not a bit field) */
 PERLVARI(Gveto_cleanup,        int, FALSE)     /* exit without cleanup */
 
-/* dummy variables that hold pointers to both runops functions, thus forcing
- * them *both* to get linked in (useful for Peek.xs, debugging etc) */
-
-PERLVARI(Grunops_std,  runops_proc_t,  Perl_runops_standard)
-PERLVARI(Grunops_dbg,  runops_proc_t,  Perl_runops_debug)
-
 /*
 =for apidoc AmUx|Perl_keyword_plugin_t|PL_keyword_plugin