diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-05-01 22:12:15 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-06-12 16:15:22 +0200 |
commit | 724cf8d623675450a9b7be794b6b3917972e83f8 (patch) | |
tree | 11ea73b19174ec36c2b07b09d87cc4de49b2cea0 | |
parent | 9e08d3a49aaebdf17eb8671b022395f689827205 (diff) | |
download | perl-724cf8d623675450a9b7be794b6b3917972e83f8.tar.gz |
Move PL_global_struct_size, PL_interp_size{,_5_16_0} to perl.h
Make them const U16 - they should have been const from the start.
-rw-r--r-- | embedvar.h | 9 | ||||
-rw-r--r-- | globvar.sym | 3 | ||||
-rw-r--r-- | perl.h | 17 | ||||
-rw-r--r-- | perlapi.h | 6 | ||||
-rw-r--r-- | perlvars.h | 18 |
5 files changed, 20 insertions, 33 deletions
diff --git a/embedvar.h b/embedvar.h index bd1d5628dd..296a3b44e3 100644 --- a/embedvar.h +++ b/embedvar.h @@ -723,14 +723,8 @@ #define PL_Gdollarzero_mutex (my_vars->Gdollarzero_mutex) #define PL_fold_locale (my_vars->Gfold_locale) #define PL_Gfold_locale (my_vars->Gfold_locale) -#define PL_global_struct_size (my_vars->Gglobal_struct_size) -#define PL_Gglobal_struct_size (my_vars->Gglobal_struct_size) #define PL_hints_mutex (my_vars->Ghints_mutex) #define PL_Ghints_mutex (my_vars->Ghints_mutex) -#define PL_interp_size (my_vars->Ginterp_size) -#define PL_Ginterp_size (my_vars->Ginterp_size) -#define PL_interp_size_5_16_0 (my_vars->Ginterp_size_5_16_0) -#define PL_Ginterp_size_5_16_0 (my_vars->Ginterp_size_5_16_0) #define PL_keyword_plugin (my_vars->Gkeyword_plugin) #define PL_Gkeyword_plugin (my_vars->Gkeyword_plugin) #define PL_malloc_mutex (my_vars->Gmalloc_mutex) @@ -797,10 +791,7 @@ #define PL_Gdo_undump PL_do_undump #define PL_Gdollarzero_mutex PL_dollarzero_mutex #define PL_Gfold_locale PL_fold_locale -#define PL_Gglobal_struct_size PL_global_struct_size #define PL_Ghints_mutex PL_hints_mutex -#define PL_Ginterp_size PL_interp_size -#define PL_Ginterp_size_5_16_0 PL_interp_size_5_16_0 #define PL_Gkeyword_plugin PL_keyword_plugin #define PL_Gmalloc_mutex PL_malloc_mutex #define PL_Gmmap_page_size PL_mmap_page_size diff --git a/globvar.sym b/globvar.sym index 9bfdb23949..81472f6150 100644 --- a/globvar.sym +++ b/globvar.sym @@ -14,7 +14,10 @@ fold fold_latin1 fold_locale freq +global_struct_size hexdigit +interp_size +interp_size_5_16_0 keyword_plugin magic_data magic_vtables @@ -4916,6 +4916,20 @@ struct interpreter { # include "intrpvar.h" }; +EXTCONST U16 PL_interp_size + INIT(sizeof(struct interpreter)); + +# define PERL_INTERPRETER_SIZE_UPTO_MEMBER(member) \ + STRUCT_OFFSET(struct interpreter, member) + \ + sizeof(((struct interpreter*)0)->member) + +/* This will be useful for subsequent releases, because this has to be the + same in your libperl as in main(), else you have a mismatch and must abort. +*/ +EXTCONST U16 PL_interp_size_5_16_0 + INIT(PERL_INTERPRETER_SIZE_UPTO_MEMBER(PERL_LAST_5_16_0_INTERP_MEMBER)); + + # ifdef PERL_GLOBAL_STRUCT /* MULTIPLICITY is automatically defined when PERL_GLOBAL_STRUCT is defined, hence it's safe and sane to nest this within #ifdef MULTIPLICITY */ @@ -4924,6 +4938,9 @@ struct perl_vars { # include "perlvars.h" }; +EXTCONST U16 PL_global_struct_size + INIT(sizeof(struct perl_vars)); + # ifdef PERL_CORE # ifndef PERL_GLOBAL_STRUCT_PRIVATE EXT struct perl_vars PL_Vars; @@ -113,14 +113,8 @@ END_EXTERN_C #define PL_dollarzero_mutex (*Perl_Gdollarzero_mutex_ptr(NULL)) #undef PL_fold_locale #define PL_fold_locale (*Perl_Gfold_locale_ptr(NULL)) -#undef PL_global_struct_size -#define PL_global_struct_size (*Perl_Gglobal_struct_size_ptr(NULL)) #undef PL_hints_mutex #define PL_hints_mutex (*Perl_Ghints_mutex_ptr(NULL)) -#undef PL_interp_size -#define PL_interp_size (*Perl_Ginterp_size_ptr(NULL)) -#undef PL_interp_size_5_16_0 -#define PL_interp_size_5_16_0 (*Perl_Ginterp_size_5_16_0_ptr(NULL)) #undef PL_keyword_plugin #define PL_keyword_plugin (*Perl_Gkeyword_plugin_ptr(NULL)) #undef PL_malloc_mutex diff --git a/perlvars.h b/perlvars.h index bad7a16d8b..bf298c08b0 100644 --- a/perlvars.h +++ b/perlvars.h @@ -145,24 +145,6 @@ PERLVARI(Gveto_cleanup, int, FALSE) /* exit without cleanup */ PERLVARI(Grunops_std, runops_proc_t, Perl_runops_standard) PERLVARI(Grunops_dbg, runops_proc_t, Perl_runops_debug) -#if defined(MULTIPLICITY) -# define PERL_INTERPRETER_SIZE_UPTO_MEMBER(member) \ - STRUCT_OFFSET(struct interpreter, member) + \ - sizeof(((struct interpreter*)0)->member) - -/* These might be useful. */ -PERLVARI(Ginterp_size, U16, sizeof(struct interpreter)) -#if defined(PERL_GLOBAL_STRUCT) -PERLVARI(Gglobal_struct_size, U16, sizeof(struct perl_vars)) -#endif - -/* This will be useful for subsequent releases, because this has to be the - same in your libperl as in main(), else you have a mismatch and must abort. -*/ -PERLVARI(Ginterp_size_5_16_0, U16, - PERL_INTERPRETER_SIZE_UPTO_MEMBER(PERL_LAST_5_16_0_INTERP_MEMBER)) -#endif - /* =for apidoc AmUx|Perl_keyword_plugin_t|PL_keyword_plugin |