Change 32672 by [EMAIL PROTECTED] on 2007/12/20 17:47:48

        Perl_magic_setglob() is a mathom.

Affected files ...

... //depot/perl/embed.fnc#538 edit
... //depot/perl/embed.h#725 edit
... //depot/perl/mathoms.c#80 edit
... //depot/perl/mg.c#510 edit
... //depot/perl/proto.h#874 edit

Differences ...

==== //depot/perl/embed.fnc#538 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#537~32241~   2007-11-08 02:31:55.000000000 -0800
+++ perl/embed.fnc      2007-12-20 09:47:48.000000000 -0800
@@ -462,7 +462,9 @@
 p      |int    |magic_setfm    |NN SV* sv|NN MAGIC* mg
 dp     |int    |magic_sethint  |NN SV* sv|NN MAGIC* mg
 p      |int    |magic_setisa   |NN SV* sv|NN MAGIC* mg
+#ifndef NO_MATHOMS
 p      |int    |magic_setglob  |NN SV* sv|NN MAGIC* mg
+#endif
 p      |int    |magic_setmglob |NN SV* sv|NN MAGIC* mg
 p      |int    |magic_setnkeys |NN SV* sv|NN MAGIC* mg
 p      |int    |magic_setpack  |NN SV* sv|NN MAGIC* mg

==== //depot/perl/embed.h#725 (text+w) ====
Index: perl/embed.h
--- perl/embed.h#724~32241~     2007-11-08 02:31:55.000000000 -0800
+++ perl/embed.h        2007-12-20 09:47:48.000000000 -0800
@@ -433,7 +433,13 @@
 #define magic_setfm            Perl_magic_setfm
 #define magic_sethint          Perl_magic_sethint
 #define magic_setisa           Perl_magic_setisa
+#endif
+#ifndef NO_MATHOMS
+#ifdef PERL_CORE
 #define magic_setglob          Perl_magic_setglob
+#endif
+#endif
+#ifdef PERL_CORE
 #define magic_setmglob         Perl_magic_setmglob
 #define magic_setnkeys         Perl_magic_setnkeys
 #define magic_setpack          Perl_magic_setpack
@@ -2722,7 +2728,13 @@
 #define magic_setfm(a,b)       Perl_magic_setfm(aTHX_ a,b)
 #define magic_sethint(a,b)     Perl_magic_sethint(aTHX_ a,b)
 #define magic_setisa(a,b)      Perl_magic_setisa(aTHX_ a,b)
+#endif
+#ifndef NO_MATHOMS
+#ifdef PERL_CORE
 #define magic_setglob(a,b)     Perl_magic_setglob(aTHX_ a,b)
+#endif
+#endif
+#ifdef PERL_CORE
 #define magic_setmglob(a,b)    Perl_magic_setmglob(aTHX_ a,b)
 #define magic_setnkeys(a,b)    Perl_magic_setnkeys(aTHX_ a,b)
 #define magic_setpack(a,b)     Perl_magic_setpack(aTHX_ a,b)

==== //depot/perl/mathoms.c#80 (text) ====
Index: perl/mathoms.c
--- perl/mathoms.c#79~32237~    2007-11-07 15:23:27.000000000 -0800
+++ perl/mathoms.c      2007-12-20 09:47:48.000000000 -0800
@@ -65,6 +65,7 @@
 PERL_CALLCONV void Perl_sv_usepvn(pTHX_ SV *sv, char *ptr, STRLEN len);
 PERL_CALLCONV int Perl_fprintf_nocontext(PerlIO *stream, const char *format, 
...);
 PERL_CALLCONV int Perl_printf_nocontext(const char *format, ...);
+PERL_CALLCONV int Perl_magic_setglob(pTHX_ SV* sv, MAGIC* mg);
 
 
 /* ref() is now a macro using Perl_doref;
@@ -1315,6 +1316,18 @@
                            NULL, 0);
 }
 
+/* Functions after here were made mathoms post 5.10.0 but pre 5.8.9 */
+int
+Perl_magic_setglob(pTHX_ SV *sv, MAGIC *mg)
+{
+    PERL_UNUSED_ARG(mg);
+    PERL_UNUSED_ARG(sv);
+
+    Perl_croak(aTHX_ "Perl_magic_setglob is dead code?");
+
+    return 0;
+}
+
 #endif /* NO_MATHOMS */
 
 /*

==== //depot/perl/mg.c#510 (text) ====
Index: perl/mg.c
--- perl/mg.c#509~32137~        2007-10-18 11:07:19.000000000 -0700
+++ perl/mg.c   2007-12-20 09:47:48.000000000 -0800
@@ -1928,30 +1928,6 @@
 }
 
 int
-Perl_magic_setglob(pTHX_ SV *sv, MAGIC *mg)
-{
-    GV* gv;
-    PERL_UNUSED_ARG(mg);
-
-    Perl_croak(aTHX_ "Perl_magic_setglob is dead code?");
-
-    if (!SvOK(sv))
-       return 0;
-    if (isGV_with_GP(sv)) {
-       /* We're actually already a typeglob, so don't need the stuff below.
-        */
-       return 0;
-    }
-    gv =  gv_fetchsv(sv, GV_ADD, SVt_PVGV);
-    if (sv == (SV*)gv)
-       return 0;
-    if (GvGP(sv))
-       gp_free((GV*)sv);
-    GvGP(sv) = gp_ref(GvGP(gv));
-    return 0;
-}
-
-int
 Perl_magic_getsubstr(pTHX_ SV *sv, MAGIC *mg)
 {
     STRLEN len;

==== //depot/perl/proto.h#874 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#873~32241~     2007-11-08 02:31:55.000000000 -0800
+++ perl/proto.h        2007-12-20 09:47:48.000000000 -0800
@@ -1218,10 +1218,12 @@
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 
+#ifndef NO_MATHOMS
 PERL_CALLCONV int      Perl_magic_setglob(pTHX_ SV* sv, MAGIC* mg)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 
+#endif
 PERL_CALLCONV int      Perl_magic_setmglob(pTHX_ SV* sv, MAGIC* mg)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
End of Patch.

Reply via email to