[win32] reverse integrate mainline
Gurusamy Sarathy [Tue, 25 Nov 1997 20:32:12 +0000 (20:32 +0000)]
p4raw-id: //depot/win32/perl@302

op.c
perl.h
perly.c
perly.y
pod/perlfunc.pod
t/lib/thread.t [changed mode: 0755->0644]
t/op/nothread.t [changed mode: 0755->0644]
vms/perly_c.vms
win32/win32thread.h

diff --git a/op.c b/op.c
index 6c29226..c86880c 100644 (file)
--- a/op.c
+++ b/op.c
@@ -531,8 +531,7 @@ find_threadsv(char *name)
        case '\'':
            sawampersand = TRUE;
            SvREADONLY_on(sv);
-           sv_magic(sv, 0, 0, name, 1); 
-           break;
+           /* FALL THROUGH */
        default:
            sv_magic(sv, 0, 0, name, 1); 
        }
@@ -4414,7 +4413,7 @@ ck_shift(OP *o)
        
        op_free(o);
 #ifdef USE_THREADS
-       if (subline > 0) {
+       if (!CvUNIQUE(compcv)) {
            argop = newOP(OP_PADAV, OPf_REF);
            argop->op_targ = 0;         /* curpad[0] is @_ */
        }
@@ -4425,7 +4424,7 @@ ck_shift(OP *o)
        }
 #else
        argop = newUNOP(OP_RV2AV, 0,
-           scalar(newGVOP(OP_GV, 0, subline > 0 ?
+           scalar(newGVOP(OP_GV, 0, !CvUNIQUE(compcv) ?
                           defgv : gv_fetchpv("ARGV", TRUE, SVt_PVAV))));
 #endif /* USE_THREADS */
        return newUNOP(type, 0, scalar(argop));
diff --git a/perl.h b/perl.h
index 0ffb04c..c05d4a9 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -2309,6 +2309,10 @@ EXT bool numeric_local INIT(TRUE);    /* Assume local numerics */
 #define PERL_SCRIPT_MODE "r"
 #endif
 
+#ifndef PERL_SCRIPT_MODE
+#define PERL_SCRIPT_MODE "r"
+#endif
+
 /*
  * nice_chunk and nice_chunk size need to be set
  * and queried under the protection of sv_mutex
diff --git a/perly.c b/perly.c
index 9ae4211..7117566 100644 (file)
--- a/perly.c
+++ b/perly.c
@@ -1767,7 +1767,7 @@ case 56:
 { char *name = SvPV(((SVOP*)yyvsp[0].opval)->op_sv, na);
                          if (strEQ(name, "BEGIN") || strEQ(name, "END")
                              || strEQ(name, "INIT"))
-                         { CvUNIQUE_on(compcv); subline = -subline; }
+                             CvUNIQUE_on(compcv);
                          yyval.opval = yyvsp[0].opval; }
 break;
 case 57:
diff --git a/perly.y b/perly.y
index fa0e0f5..481a2cc 100644 (file)
--- a/perly.y
+++ b/perly.y
@@ -291,7 +291,7 @@ startformsub:       /* NULL */      /* start a format subroutine scope */
 subname        :       WORD    { char *name = SvPV(((SVOP*)$1)->op_sv, na);
                          if (strEQ(name, "BEGIN") || strEQ(name, "END")
                              || strEQ(name, "INIT"))
-                         { CvUNIQUE_on(compcv); subline = -subline; }
+                             CvUNIQUE_on(compcv);
                          $$ = $1; }
        ;
 
index aa1e82e..887f827 100644 (file)
@@ -2856,10 +2856,12 @@ argument.
 Shifts the first value of the array off and returns it, shortening the
 array by 1 and moving everything down.  If there are no elements in the
 array, returns the undefined value.  If ARRAY is omitted, shifts the
-@ARGV array in the main program, and the @_ array in subroutines.
-(This is determined lexically.)  See also unshift(), push(), and pop().
-Shift() and unshift() do the same thing to the left end of an array
-that pop() and push() do to the right end.
+@_ array within the lexical scope of subroutines and formats, and the
+@ARGV array at file scopes or within the lexical scopes established by
+the C<eval ''>, C<BEGIN {}>, C<END {}>, and C<INIT {}> constructs.
+See also unshift(), push(), and pop().  Shift() and unshift() do the
+same thing to the left end of an array that pop() and push() do to the
+right end.
 
 =item shmctl ID,CMD,ARG
 
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index e3c100b..7514f16 100644 (file)
@@ -1770,7 +1770,7 @@ case 56:
 { char *name = SvPV(((SVOP*)yyvsp[0].opval)->op_sv, na);
                          if (strEQ(name, "BEGIN") || strEQ(name, "END")
                              || strEQ(name, "INIT"))
-                         { CvUNIQUE_on(compcv); subline = -subline; }
+                             CvUNIQUE_on(compcv);
                          yyval.opval = yyvsp[0].opval; }
 break;
 case 57:
index 0d92ffc..591184b 100644 (file)
@@ -97,7 +97,7 @@ typedef HANDLE perl_mutex;
        }                                                       \
     } STMT_END
 
-#define THR ((struct perl_thread *) TlsGetValue(thr_key))
+
 #define THREAD_CREATE(t, f)    Perl_thread_create(t, f)
 #define THREAD_POST_CREATE(t)  NOOP
 #define THREAD_RET_TYPE                DWORD WINAPI
@@ -109,7 +109,7 @@ typedef THREAD_RET_TYPE thread_func_t(void *);
 START_EXTERN_C
 
 #if defined(PERLDLL) && (!defined(__BORLANDC__) || defined(_DLL))
-extern __declspec(thread) struct thread *Perl_current_thread;
+extern __declspec(thread) struct perl_thread *Perl_current_thread;
 #define SET_THR(t)             (Perl_current_thread = t)
 #define THR                    Perl_current_thread
 #else
@@ -122,6 +122,7 @@ int Perl_thread_create _((struct perl_thread *thr, thread_func_t *fn));
 void Perl_set_thread_self _((struct perl_thread *thr));
 struct perl_thread *Perl_getTHR _((void));
 void Perl_setTHR _((struct perl_thread *t));
+
 END_EXTERN_C
 
 #define INIT_THREADS NOOP