It looks like the only way to reliably make Perl_hv_name_set a pure
Nicholas Clark [Sun, 18 Sep 2005 21:52:25 +0000 (21:52 +0000)]
macro in 5.8.x is to make it available as hv_name_set.
[Otherwise when and where aTHX_ hv gets expanded to foo, hv causes
 warnings or other games when Perl_hv_name_set() is a macro]

p4raw-id: //depot/perl@25475

embed.fnc
ext/Opcode/Opcode.xs
gv.c
hv.c
perl.c

index a1fbaa7..c173151 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -1440,7 +1440,7 @@ ApoR      |I32*   |hv_riter_p     |NN HV* hv
 ApoR   |HE**   |hv_eiter_p     |NN HV* hv
 Apo    |void   |hv_riter_set   |NN HV* hv|I32 riter
 Apo    |void   |hv_eiter_set   |NN HV* hv|NULLOK HE* eiter
-Apo    |void   |hv_name_set    |NN HV* hv|NULLOK const char *name|I32 len|int flags
+Ap     |void   |hv_name_set    |NN HV* hv|NULLOK const char *name|I32 len|int flags
 Apd    |void   |hv_clear_placeholders  |NN HV* hb
 ApoR   |I32*   |hv_placeholders_p      |NN HV* hv
 ApoR   |I32    |hv_placeholders_get    |NN HV* hv
index a699ebf..b313999 100644 (file)
@@ -269,7 +269,7 @@ PPCODE:
 
     if (strNE(HvNAME_get(hv),"main")) {
         /* make it think it's in main:: */
-       Perl_hv_name_set(aTHX_ hv, "main", 4, 0);
+       hv_name_set(hv, "main", 4, 0);
         hv_store(hv,"_",1,(SV *)PL_defgv,0);  /* connect _ to global */
         SvREFCNT_inc((SV *)PL_defgv);  /* want to keep _ around! */
     }
diff --git a/gv.c b/gv.c
index 77ca69f..1543059 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -669,7 +669,7 @@ Perl_gv_stashpvn(pTHX_ const char *name, U32 namelen, I32 create)
        GvHV(tmpgv) = newHV();
     stash = GvHV(tmpgv);
     if (!HvNAME_get(stash))
-       Perl_hv_name_set(aTHX_ stash, name, namelen, 0);
+       hv_name_set(stash, name, namelen, 0);
     return stash;
 }
 
@@ -759,7 +759,7 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags,
                    stash = GvHV(gv) = newHV();
 
                if (!HvNAME_get(stash))
-                   Perl_hv_name_set(aTHX_ stash, nambeg, namend - nambeg, 0);
+                   hv_name_set(stash, nambeg, namend - nambeg, 0);
            }
 
            if (*namend == ':')
diff --git a/hv.c b/hv.c
index 32503a9..147efcc 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -1730,7 +1730,7 @@ Perl_hv_undef(pTHX_ HV *hv)
     if ((name = HvNAME_get(hv))) {
         if(PL_stashcache)
            hv_delete(PL_stashcache, name, HvNAMELEN_get(hv), G_DISCARD);
-       Perl_hv_name_set(aTHX_ hv, Nullch, 0, 0);
+       hv_name_set(hv, Nullch, 0, 0);
     }
     SvFLAGS(hv) &= ~SVf_OOK;
     Safefree(HvARRAY(hv));
diff --git a/perl.c b/perl.c
index 188e193..0b21655 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -3415,7 +3415,7 @@ S_init_main_stash(pTHX)
     SvREFCNT_dec(GvHV(gv));
     GvHV(gv) = (HV*)SvREFCNT_inc(PL_defstash);
     SvREADONLY_on(gv);
-    Perl_hv_name_set(aTHX_ PL_defstash, "main", 4, 0);
+    hv_name_set(PL_defstash, "main", 4, 0);
     PL_incgv = gv_HVadd(gv_AVadd(gv_fetchpv("INC",TRUE, SVt_PVAV)));
     GvMULTI_on(PL_incgv);
     PL_hintgv = gv_fetchpv("\010",TRUE, SVt_PV); /* ^H */