[win32] merge change#981 from maintbranch, add XXX comment about
Gurusamy Sarathy [Fri, 15 May 1998 22:08:17 +0000 (22:08 +0000)]
supporting %! for usethreads case

p4raw-link: @981 on //depot/maint-5.004/perl: 46d9186cfa8aceca37f3cc539b5e08e8f8b72412

p4raw-id: //depot/win32/perl@994

gv.c
op.c

diff --git a/gv.c b/gv.c
index 94d4a7e..5d65d60 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -709,13 +709,28 @@ gv_fetchpv(char *nambeg, I32 add, I32 sv_type)
 #endif
        goto magicalize;
 
+    case '!':
+       if(len > 1)
+           break;
+       if(sv_type == SVt_PVHV) {
+           HV* stash = gv_stashpvn("Errno",5,FALSE);
+           if(!stash || !(gv_fetchmethod(stash, "TIEHASH"))) {
+               dSP;
+               PUTBACK;
+               perl_require_pv("Errno.pm");
+               SPAGAIN;
+               stash = gv_stashpvn("Errno",5,FALSE);
+               if (!stash || !(gv_fetchmethod(stash, "TIEHASH")))
+                   croak("%! is not avaliable on this machine");
+           }
+       }
+       goto magicalize;
     case '#':
     case '*':
        if (dowarn && len == 1 && sv_type == SVt_PV)
            warn("Use of $%s is deprecated", name);
        /* FALL THROUGH */
     case '[':
-    case '!':
     case '^':
     case '~':
     case '=':
diff --git a/op.c b/op.c
index 532b0a7..beaac6a 100644 (file)
--- a/op.c
+++ b/op.c
@@ -532,6 +532,11 @@ find_threadsv(char *name)
            sawampersand = TRUE;
            SvREADONLY_on(sv);
            /* FALL THROUGH */
+
+       /* XXX %! tied to Errno.pm needs to be added here.
+        * See gv_fetchpv(). */
+       /* case '!': */
+
        default:
            sv_magic(sv, 0, 0, name, 1); 
        }