diff options
author | David Mitchell <davem@iabyn.com> | 2017-03-17 13:15:13 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2017-03-17 14:10:14 +0000 |
commit | 7bfe3bfdd4427cdc26a2581cc633e3fb5582ce70 (patch) | |
tree | 6445abb6d82da6875a1e12b79c25d7c39b64e9fc | |
parent | a5555695d6543e0b1a47bec20245db4878556a6d (diff) | |
download | perl-7bfe3bfdd4427cdc26a2581cc633e3fb5582ce70.tar.gz |
PERL_GLOBAL_STRUCT_PRIVATE: fix PL_isa_DOES
I added the global string constant PL_isa_DOES recently. This caused
t/porting/libperl.t to fail under -DPERL_GLOBAL_STRUCT_PRIVATE builds.
This commit makes PL_isa_DOES be declared and defined in a similar
way to other such global constants. This is pure cargo-culting - I have no
real idea of the point of all the EXTCONST, INIT and globvar.sym stuff.
-rw-r--r-- | globvar.sym | 1 | ||||
-rw-r--r-- | perl.h | 6 | ||||
-rw-r--r-- | pp_hot.c | 2 | ||||
-rw-r--r-- | universal.c | 7 |
4 files changed, 8 insertions, 8 deletions
diff --git a/globvar.sym b/globvar.sym index 2943fc6691..c82dc8f1c8 100644 --- a/globvar.sym +++ b/globvar.sym @@ -19,6 +19,7 @@ PL_hexdigit PL_inf PL_interp_size PL_interp_size_5_18_0 +PL_isa_DOES PL_keyword_plugin PL_latin1_lc PL_magic_data @@ -4799,6 +4799,12 @@ EXTCONST U8 PL_subversion EXTCONST char PL_uuemap[65] INIT("`!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"); +/* a special string address whose value is "isa", but which perl knows + * to treat as if it were really "DOES" when printing the method name in + * the "Can't call method '%s'" error message */ +EXTCONST char PL_isa_DOES[] + INIT("isa"); + #ifdef DOINIT EXTCONST char PL_uudmap[256] = # ifdef PERL_MICRO @@ -4391,8 +4391,6 @@ Perl_vivify_ref(pTHX_ SV *sv, U32 to_what) return sv; } -extern char PL_isa_DOES[]; - PERL_STATIC_INLINE HV * S_opmethod_stash(pTHX_ SV* meth) { diff --git a/universal.c b/universal.c index 88835f9d78..be39310da7 100644 --- a/universal.c +++ b/universal.c @@ -184,11 +184,6 @@ The SV can be a Perl object or the name of a Perl class. #include "XSUB.h" -/* a special string address whose value is "isa", but which perl knows - * to treat as if it were really "DOES" when printing the method name in - * the "Can't call method '%s'" error message */ -char PL_isa_DOES[] = "isa"; - bool Perl_sv_does_sv(pTHX_ SV *sv, SV *namesv, U32 flags) { @@ -232,7 +227,7 @@ Perl_sv_does_sv(pTHX_ SV *sv, SV *namesv, U32 flags) methodname = newSV_type(SVt_PV); SvLEN(methodname) = 0; SvCUR(methodname) = strlen(PL_isa_DOES); - SvPVX(methodname) = PL_isa_DOES; + SvPVX(methodname) = (char *)PL_isa_DOES; /* discard 'const' qualifier */ SvPOK_on(methodname); sv_2mortal(methodname); call_sv(methodname, G_SCALAR | G_METHOD); |