diff options
-rw-r--r-- | embedvar.h | 9 | ||||
-rw-r--r-- | globvar.sym | 3 | ||||
-rw-r--r-- | perl.h | 10 | ||||
-rw-r--r-- | perlapi.c | 4 | ||||
-rw-r--r-- | perlapi.h | 12 | ||||
-rw-r--r-- | perlvars.h | 6 | ||||
-rwxr-xr-x | regen/embed.pl | 12 | ||||
-rw-r--r-- | util.c | 3 |
8 files changed, 11 insertions, 48 deletions
diff --git a/embedvar.h b/embedvar.h index 13d2e56606..3d5fb88eab 100644 --- a/embedvar.h +++ b/embedvar.h @@ -709,10 +709,6 @@ #if defined(PERL_GLOBAL_STRUCT) -#define PL_No (my_vars->GNo) -#define PL_GNo (my_vars->GNo) -#define PL_Yes (my_vars->GYes) -#define PL_GYes (my_vars->GYes) #define PL_appctx (my_vars->Gappctx) #define PL_Gappctx (my_vars->Gappctx) #define PL_check (my_vars->Gcheck) @@ -729,8 +725,6 @@ #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_hexdigit (my_vars->Ghexdigit) -#define PL_Ghexdigit (my_vars->Ghexdigit) #define PL_hints_mutex (my_vars->Ghints_mutex) #define PL_Ghints_mutex (my_vars->Ghints_mutex) #define PL_interp_size (my_vars->Ginterp_size) @@ -800,8 +794,6 @@ #else /* !PERL_GLOBAL_STRUCT */ -#define PL_GNo PL_No -#define PL_GYes PL_Yes #define PL_Gappctx PL_appctx #define PL_Gcheck PL_check #define PL_Gcsighandlerp PL_csighandlerp @@ -810,7 +802,6 @@ #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_Ghexdigit PL_hexdigit #define PL_Ghints_mutex PL_hints_mutex #define PL_Ginterp_size PL_interp_size #define PL_Ginterp_size_5_10_0 PL_interp_size_5_10_0 diff --git a/globvar.sym b/globvar.sym index 9bec86189b..83e7e1ac6e 100644 --- a/globvar.sym +++ b/globvar.sym @@ -3,6 +3,8 @@ # *** Only structures/arrays with constant initializers should go here. # *** Usual globals initialized at runtime should be added in *var*.h. +No +Yes bincompat_options block_type charclass @@ -12,6 +14,7 @@ fold fold_latin1 fold_locale freq +hexdigit keyword_plugin magic_data magic_vtables @@ -4244,6 +4244,13 @@ EXTCONST char PL_no_localize_ref[] EXTCONST char PL_memory_wrap[] INIT("panic: memory wrap"); +EXTCONST char PL_Yes[] + INIT("1"); +EXTCONST char PL_No[] + INIT(""); +EXTCONST char PL_hexdigit[] + INIT("0123456789abcdef0123456789ABCDEF"); + #ifdef CSH EXTCONST char PL_cshname[] INIT(CSH); @@ -4887,7 +4894,6 @@ struct interpreter { # define PERLVARA(var,n,type) type var[n]; # define PERLVARI(var,type,init) type var; # define PERLVARIC(var,type,init) type var; -# define PERLVARISC(var,init) const char var[sizeof(init)]; struct interpreter { # include "intrpvar.h" @@ -4923,7 +4929,6 @@ struct perl_vars *PL_VarsPtr; # undef PERLVARA # undef PERLVARI # undef PERLVARIC -# undef PERLVARISC #endif /* MULTIPLICITY */ @@ -4974,7 +4979,6 @@ struct tempsym; /* defined in pp_pack.c */ #define PERLVARA(var,n,type) EXT type PL_##var[n]; #define PERLVARI(var,type,init) EXT type PL_##var INIT(init); #define PERLVARIC(var,type,init) EXTCONST type PL_##var INIT(init); -#define PERLVARISC(var,init) EXTCONST char PL_##var[sizeof(init)] INIT(init); #if !defined(MULTIPLICITY) START_EXTERN_C @@ -43,19 +43,15 @@ START_EXTERN_C #define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX) \ { dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); } #undef PERLVARIC -#undef PERLVARISC #define PERLVARIC(v,t,i) \ const t* Perl_##v##_ptr(pTHX) \ { PERL_UNUSED_CONTEXT; return (const t *)&(PL_##v); } -#define PERLVARISC(v,i) PL_##v##_t* Perl_##v##_ptr(pTHX) \ - { dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); } #include "perlvars.h" #undef PERLVAR #undef PERLVARA #undef PERLVARI #undef PERLVARIC -#undef PERLVARISC END_EXTERN_C @@ -28,14 +28,11 @@ START_EXTERN_C #undef PERLVARA #undef PERLVARI #undef PERLVARIC -#undef PERLVARISC #define PERLVAR(v,t) EXTERN_C t* Perl_##v##_ptr(pTHX); #define PERLVARA(v,n,t) typedef t PL_##v##_t[n]; \ EXTERN_C PL_##v##_t* Perl_##v##_ptr(pTHX); #define PERLVARI(v,t,i) PERLVAR(v,t) #define PERLVARIC(v,t,i) PERLVAR(v, const t) -#define PERLVARISC(v,i) typedef const char PL_##v##_t[sizeof(i)]; \ - EXTERN_C PL_##v##_t* Perl_##v##_ptr(pTHX); #include "perlvars.h" @@ -43,7 +40,6 @@ START_EXTERN_C #undef PERLVARA #undef PERLVARI #undef PERLVARIC -#undef PERLVARISC END_EXTERN_C @@ -70,7 +66,6 @@ EXTCONST void * const PL_force_link_funcs[] = { #define PERLVARA(v,n,t) PERLVAR(v,t) #define PERLVARI(v,t,i) PERLVAR(v,t) #define PERLVARIC(v,t,i) PERLVAR(v,t) -#define PERLVARISC(v,i) PERLVAR(v,char) /* In Tru64 (__DEC && __osf__) the cc option -std1 causes that one * cannot cast between void pointers and function pointers without @@ -95,7 +90,6 @@ EXTCONST void * const PL_force_link_funcs[] = { #undef PERLVARA #undef PERLVARI #undef PERLVARIC -#undef PERLVARISC }; #endif /* DOINIT */ @@ -105,10 +99,6 @@ END_EXTERN_C #else /* !PERL_CORE */ -#undef PL_No -#define PL_No (*Perl_GNo_ptr(NULL)) -#undef PL_Yes -#define PL_Yes (*Perl_GYes_ptr(NULL)) #undef PL_appctx #define PL_appctx (*Perl_Gappctx_ptr(NULL)) #undef PL_check @@ -125,8 +115,6 @@ END_EXTERN_C #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_hexdigit -#define PL_hexdigit (*Perl_Ghexdigit_ptr(NULL)) #undef PL_hints_mutex #define PL_hints_mutex (*Perl_Ghints_mutex_ptr(NULL)) #undef PL_interp_size diff --git a/perlvars.h b/perlvars.h index cd888516ce..d3764d57d1 100644 --- a/perlvars.h +++ b/perlvars.h @@ -32,12 +32,6 @@ PERLVAR(Gcurinterp, PerlInterpreter *) PERLVAR(Gthr_key, perl_key) /* key to retrieve per-thread struct */ #endif -/* constants (these are not literals to facilitate pointer comparisons) - * (PERLVARISC really does create variables, despite its looks) */ -PERLVARISC(GYes, "1") -PERLVARISC(GNo, "") -PERLVARISC(Ghexdigit, "0123456789abcdef0123456789ABCDEF") - /* XXX does anyone even use this? */ PERLVARI(Gdo_undump, bool, FALSE) /* -u or dump seen? */ diff --git a/regen/embed.pl b/regen/embed.pl index a72a0f7651..89b128e96c 100755 --- a/regen/embed.pl +++ b/regen/embed.pl @@ -367,7 +367,7 @@ sub readvars(\%$$@) { or die "embed.pl: Can't open $file: $!\n"; while (<FILE>) { s/[ \t]*#.*//; # Delete comments. - if (/PERLVARA?I?S?C?\($pre(\w+)/) { + if (/PERLVARA?I?C?\($pre(\w+)/) { my $sym = $1; $sym = $pre . $sym if $keep_pre; warn "duplicate symbol $sym while processing $file line $.\n" @@ -667,14 +667,11 @@ START_EXTERN_C #undef PERLVARA #undef PERLVARI #undef PERLVARIC -#undef PERLVARISC #define PERLVAR(v,t) EXTERN_C t* Perl_##v##_ptr(pTHX); #define PERLVARA(v,n,t) typedef t PL_##v##_t[n]; \ EXTERN_C PL_##v##_t* Perl_##v##_ptr(pTHX); #define PERLVARI(v,t,i) PERLVAR(v,t) #define PERLVARIC(v,t,i) PERLVAR(v, const t) -#define PERLVARISC(v,i) typedef const char PL_##v##_t[sizeof(i)]; \ - EXTERN_C PL_##v##_t* Perl_##v##_ptr(pTHX); #include "perlvars.h" @@ -682,7 +679,6 @@ START_EXTERN_C #undef PERLVARA #undef PERLVARI #undef PERLVARIC -#undef PERLVARISC END_EXTERN_C @@ -709,7 +705,6 @@ EXTCONST void * const PL_force_link_funcs[] = { #define PERLVARA(v,n,t) PERLVAR(v,t) #define PERLVARI(v,t,i) PERLVAR(v,t) #define PERLVARIC(v,t,i) PERLVAR(v,t) -#define PERLVARISC(v,i) PERLVAR(v,char) /* In Tru64 (__DEC && __osf__) the cc option -std1 causes that one * cannot cast between void pointers and function pointers without @@ -734,7 +729,6 @@ EXTCONST void * const PL_force_link_funcs[] = { #undef PERLVARA #undef PERLVARI #undef PERLVARIC -#undef PERLVARISC }; #endif /* DOINIT */ @@ -792,19 +786,15 @@ START_EXTERN_C #define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX) \ { dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); } #undef PERLVARIC -#undef PERLVARISC #define PERLVARIC(v,t,i) \ const t* Perl_##v##_ptr(pTHX) \ { PERL_UNUSED_CONTEXT; return (const t *)&(PL_##v); } -#define PERLVARISC(v,i) PL_##v##_t* Perl_##v##_ptr(pTHX) \ - { dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); } #include "perlvars.h" #undef PERLVAR #undef PERLVARA #undef PERLVARI #undef PERLVARIC -#undef PERLVARISC END_EXTERN_C @@ -5800,18 +5800,15 @@ Perl_init_global_struct(pTHX) # undef PERLVARA # undef PERLVARI # undef PERLVARIC -# undef PERLVARISC # define PERLVAR(var,type) /**/ # define PERLVARA(var,n,type) /**/ # define PERLVARI(var,type,init) plvarsp->var = init; # define PERLVARIC(var,type,init) plvarsp->var = init; -# define PERLVARISC(var,init) Copy(init, plvarsp->var, sizeof(init), char); # include "perlvars.h" # undef PERLVAR # undef PERLVARA # undef PERLVARI # undef PERLVARIC -# undef PERLVARISC # ifdef PERL_GLOBAL_STRUCT plvarsp->Gppaddr = (Perl_ppaddr_t*) |