This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
the workaround is needed in all 7.2.* compilers,
[perl5.git] / mg.c
diff --git a/mg.c b/mg.c
index 893f4ff..904381a 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -567,13 +567,10 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
        sv_setiv(sv, (IV)PL_basetime);
 #endif
        break;
-    case '\025':               /* ^U */
-       sv_setiv(sv, (IV)PL_bigchar);
-       break;
-    case '\027':               /* ^W  & $^Warnings*/
+    case '\027':               /* ^W  & $^WARNING_BITS & ^WIDE_SYSTEM_CALLS */
        if (*(mg->mg_ptr+1) == '\0')
            sv_setiv(sv, (IV)((PL_dowarn & G_WARN_ON) ? TRUE : FALSE));
-       else if (strEQ(mg->mg_ptr, "\027arnings")) {
+       else if (strEQ(mg->mg_ptr, "\027ARNING_BITS")) {
            if (PL_compiling.cop_warnings == WARN_NONE ||
                PL_compiling.cop_warnings == WARN_STD)
            {
@@ -586,6 +583,8 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
                sv_setsv(sv, PL_compiling.cop_warnings);
            }    
        }
+       else if (strEQ(mg->mg_ptr, "\027IDE_SYSTEM_CALLS"))
+           sv_setiv(sv, (IV)PL_widesyscalls);
        break;
     case '1': case '2': case '3': case '4':
     case '5': case '6': case '7': case '8': case '9': case '&':
@@ -1010,7 +1009,7 @@ Perl_magic_setsig(pTHX_ SV *sv, MAGIC *mg)
     else {
        i = whichsig(s);        /* ...no, a brick */
        if (!i) {
-           if (ckWARN(WARN_SIGNAL) || strEQ(s,"ALARM"))
+           if (ckWARN(WARN_SIGNAL))
                Perl_warner(aTHX_ WARN_SIGNAL, "No such signal: SIG%s", s);
            return 0;
        }
@@ -1710,10 +1709,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
        PL_basetime = (Time_t)(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
 #endif
        break;
-    case '\025':       /* ^U */
-       PL_bigchar = SvTRUE(sv);
-       break;
-    case '\027':       /* ^W & $^Warnings */
+    case '\027':       /* ^W & $^WARNING_BITS & ^WIDE_SYSTEM_CALLS */
        if (*(mg->mg_ptr+1) == '\0') {
            if ( ! (PL_dowarn & G_WARN_ALL_MASK)) {
                i = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv);
@@ -1721,8 +1717,13 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
                                | (i ? G_WARN_ON : G_WARN_OFF) ;
            }
        }
-       else if (strEQ(mg->mg_ptr, "\027arnings")) {
+       else if (strEQ(mg->mg_ptr, "\027ARNING_BITS")) {
            if ( ! (PL_dowarn & G_WARN_ALL_MASK)) {
+               if (!SvPOK(sv) && PL_localizing) {
+                   sv_setpvn(sv, WARN_NONEstring, WARNsize);
+                   PL_compiling.cop_warnings = WARN_NONE;
+                   break;
+               }
                 if (memEQ(SvPVX(sv), WARN_ALLstring, WARNsize)) {
                    PL_compiling.cop_warnings = WARN_ALL;
                    PL_dowarn |= G_WARN_ONCE ;
@@ -1739,6 +1740,8 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
                }
            }
        }
+       else if (strEQ(mg->mg_ptr, "\027IDE_SYSTEM_CALLS"))
+           PL_widesyscalls = SvTRUE(sv);
        break;
     case '.':
        if (PL_localizing) {
@@ -2177,7 +2180,7 @@ static void
 restore_magic(pTHXo_ void *p)
 {
     dTHR;
-    MGS* mgs = SSPTR((I32)p, MGS*);
+    MGS* mgs = SSPTR(PTR2IV(p), MGS*);
     SV* sv = mgs->mgs_sv;
 
     if (!sv)