if (PL_op->op_flags & OPf_REF) {
EXTEND(SP,1);
- tmpgv = cGVOP;
+ tmpgv = cGVOP_gv;
do_fstat:
io = GvIO(tmpgv);
if (io && IoIFP(io)) {
STRLEN n_a;
if (PL_op->op_flags & OPf_REF) {
EXTEND(SP,1);
- if (cGVOP == PL_defgv) {
+ if (cGVOP_gv == PL_defgv) {
if (PL_laststype != OP_LSTAT)
Perl_croak(aTHX_ "The stat preceding -l _ wasn't an lstat");
return PL_laststatval;
#ifdef USE_ITHREADS
if (cPADOPo->op_padix > 0) {
if (PL_curpad) {
- GV *gv = cGVOPo;
+ GV *gv = cGVOPo_gv;
pad_swipe(cPADOPo->op_padix);
/* No GvIN_PAD_off(gv) here, because other references may still
* exist on the pad */
break;
}
- cv = GvCV(kGVOP);
+ cv = GvCV(kGVOP_gv);
if (!cv)
goto restore_2cv;
if (CvLVALUE(cv))
}
#else
if (curop->op_type == OP_GV) {
- GV *gv = cGVOPx(curop);
+ GV *gv = cGVOPx_gv(curop);
repl_has_vars = 1;
if (strchr("&`'123456789+", *GvENAME(gv)))
break;
for (curop = LINKLIST(o); curop != o; curop = LINKLIST(curop)) {
if (PL_opargs[curop->op_type] & OA_DANGEROUS) {
if (curop->op_type == OP_GV) {
- GV *gv = cGVOPx(curop);
+ GV *gv = cGVOPx_gv(curop);
if (gv == PL_defgv || SvCUR(gv) == PL_generation)
break;
SvCUR(gv) = PL_generation;
kid->op_type = OP_GV;
SvREFCNT_dec(kid->op_sv);
#ifdef USE_ITHREADS
- /* XXXXXX hack: dependence on sizeof(PADOP) <= sizeof(SVOP) */
+ /* XXX hack: dependence on sizeof(PADOP) <= sizeof(SVOP) */
kPADOP->op_padix = pad_alloc(OP_GV, SVs_PADTMP);
GvIN_PAD_on(gv);
PL_curpad[kPADOP->op_padix] = SvREFCNT_inc(gv);
if (kUNOP->op_first->op_type != OP_GV)
return;
kid = kUNOP->op_first; /* get past rv2sv */
- gv = kGVOP;
+ gv = kGVOP_gv;
if (GvSTASH(gv) != PL_curstash)
return;
if (strEQ(GvNAME(gv), "a"))
if (kUNOP->op_first->op_type != OP_GV)
return;
kid = kUNOP->op_first; /* get past rv2sv */
- gv = kGVOP;
+ gv = kGVOP_gv;
if (GvSTASH(gv) != PL_curstash
|| ( reversed
? strNE(GvNAME(gv), "a")
null(cvop); /* disable rv2cv */
tmpop = (SVOP*)((UNOP*)cvop)->op_first;
if (tmpop->op_type == OP_GV && !(o->op_private & OPpENTERSUB_AMPER)) {
- GV *gv = cGVOPx(tmpop);
+ GV *gv = cGVOPx_gv(tmpop);
cv = GvCVu(gv);
if (!cv)
tmpop->op_private |= OPpEARLY_CV;
(gvop = ((UNOP*)gvop)->op_first) &&
gvop->op_type == OP_GV)
{
- GV *gv = cGVOPx(gvop);
+ GV *gv = cGVOPx_gv(gvop);
OP *sibling = o2->op_sibling;
SV *n = newSVpvn("",0);
op_free(o2);
o->op_type = OP_AELEMFAST;
o->op_ppaddr = PL_ppaddr[OP_AELEMFAST];
o->op_private = (U8)i;
- gv = cGVOPo;
+ gv = cGVOPo_gv;
GvAVn(gv);
}
}
else if ((o->op_private & OPpEARLY_CV) && ckWARN(WARN_UNSAFE)) {
- GV *gv = cGVOPo;
+ GV *gv = cGVOPo_gv;
if (SvTYPE(gv) == SVt_PVGV && GvCV(gv) && SvPVX(GvCV(gv))) {
/* XXX could check prototype here instead of just carping */
SV *sv = sv_newmortal();
fields = (GV**)hv_fetch(SvSTASH(lexname), "FIELDS", 6, FALSE);
if (!fields || !GvHV(*fields))
break;
- svp = &cSVOPx_sv(((BINOP*)o)->op_last);
+ svp = cSVOPx_svp(((BINOP*)o)->op_last);
key = SvPV(*svp, keylen);
indsvp = hv_fetch(GvHV(*fields), key, keylen, FALSE);
if (!indsvp) {
#ifdef USE_ITHREADS
-# define cGVOPx(o) ((GV*)PAD_SV(cPADOPx(o)->op_padix))
-# define cGVOP ((GV*)PAD_SV(cPADOP->op_padix))
-# define cGVOPo ((GV*)PAD_SV(cPADOPo->op_padix))
-# define kGVOP ((GV*)PAD_SV(kPADOP->op_padix))
-# define cGVOP_set(v) (PL_curpad[cPADOP->op_padix] = (SV*)(v))
-# define cGVOPo_set(v) (PL_curpad[cPADOPo->op_padix] = (SV*)(v))
-# define kGVOP_set(v) (PL_curpad[kPADOP->op_padix] = (SV*)(v))
+# define cGVOPx_gv(o) ((GV*)PL_curpad[cPADOPx(o)->op_padix])
# define IS_PADGV(v) (v && SvTYPE(v) == SVt_PVGV && GvIN_PAD(v))
# define IS_PADCONST(v) (v && SvREADONLY(v))
# define cSVOPx_sv(v) (cSVOPx(v)->op_sv \
? cSVOPx(v)->op_sv : PL_curpad[(v)->op_targ])
+# define cSVOPx_svp(v) (cSVOPx(v)->op_sv \
+ ? &cSVOPx(v)->op_sv : &PL_curpad[(v)->op_targ])
#else
-# define cGVOPx(o) ((GV*)cSVOPx(o)->op_sv)
-# define cGVOP ((GV*)cSVOP->op_sv)
-# define cGVOPo ((GV*)cSVOPo->op_sv)
-# define kGVOP ((GV*)kSVOP->op_sv)
-# define cGVOP_set(v) (cPADOP->op_sv = (SV*)(v))
-# define cGVOPo_set(v) (cPADOPo->op_sv = (SV*)(v))
-# define kGVOP_set(v) (kPADOP->op_sv = (SV*)(v))
+# define cGVOPx_gv(o) ((GV*)cSVOPx(o)->op_sv)
# define IS_PADGV(v) FALSE
# define IS_PADCONST(v) FALSE
# define cSVOPx_sv(v) (cSVOPx(v)->op_sv)
+# define cSVOPx_svp(v) (&cSVOPx(v)->op_sv)
#endif
-#define cSVOP_sv cSVOPx_sv(PL_op)
-#define cSVOPo_sv cSVOPx_sv(o)
-#define kSVOP_sv cSVOPx_sv(kid)
+#define cGVOP_gv cGVOPx_gv(PL_op)
+#define cGVOPo_gv cGVOPx_gv(o)
+#define kGVOP_gv cGVOPx_gv(kid)
+#define cSVOP_sv cSVOPx_sv(PL_op)
+#define cSVOPo_sv cSVOPx_sv(o)
+#define kSVOP_sv cSVOPx_sv(kid)
#define Nullop Null(OP*)
djSP;
EXTEND(SP,1);
if (PL_op->op_private & OPpLVAL_INTRO)
- PUSHs(save_scalar(cGVOP));
+ PUSHs(save_scalar(cGVOP_gv));
else
- PUSHs(GvSV(cGVOP));
+ PUSHs(GvSV(cGVOP_gv));
RETURN;
}
PP(pp_gv)
{
djSP;
- XPUSHs((SV*)cGVOP);
+ XPUSHs((SV*)cGVOP_gv);
RETURN;
}
PP(pp_aelemfast)
{
djSP;
- AV *av = GvAV(cGVOP);
+ AV *av = GvAV(cGVOP_gv);
U32 lval = PL_op->op_flags & OPf_MOD;
SV** svp = av_fetch(av, PL_op->op_private, lval);
SV *sv = (svp ? *svp : &PL_sv_undef);
PP(pp_rcatline)
{
- PL_last_in_gv = cGVOP;
+ PL_last_in_gv = cGVOP_gv;
return do_readline();
}
STRLEN n_a;
if (PL_op->op_flags & OPf_REF) {
- tmpgv = cGVOP;
+ tmpgv = cGVOP_gv;
do_fstat:
if (tmpgv != PL_defgv) {
PL_laststype = OP_STAT;
STRLEN n_a;
if (PL_op->op_flags & OPf_REF)
- gv = cGVOP;
+ gv = cGVOP_gv;
else if (isGV(TOPs))
gv = (GV*)POPs;
else if (SvROK(TOPs) && isGV(SvRV(TOPs)))
PerlIO *fp;
if (PL_op->op_flags & OPf_REF)
- gv = cGVOP;
+ gv = cGVOP_gv;
else if (isGV(TOPs))
gv = (GV*)POPs;
else if (SvROK(TOPs) && isGV(SvRV(TOPs)))
}
else {
if (ckWARN(WARN_UNOPENED)) {
- gv = cGVOP;
+ gv = cGVOP_gv;
Perl_warner(aTHX_ WARN_UNOPENED, "Test on unopened file <%s>",
GvENAME(gv));
}
break;
case OP_GVSV:
case OP_GV:
- if (cGVOPo) {
+ if (cGVOPo_gv) {
sv = NEWSV(0,0);
- gv_fullname3(sv, cGVOPo, Nullch);
+ gv_fullname3(sv, cGVOPo_gv, Nullch);
PerlIO_printf(Perl_debug_log, "(%s)", SvPV(sv, n_a));
SvREFCNT_dec(sv);
}
# tests. This should be enabled to get the fork() emulation. Do not
# enable unless you know what you're doing!
#
-USE_ITHREADS = define
+#USE_ITHREADS = define
#
# uncomment to enable the implicit "host" layer for all system calls
# made by perl. This is needed and auto-enabled by USE_OBJECT above.
#
-USE_IMP_SYS = define
+#USE_IMP_SYS = define
#
# uncomment one of the following lines if you are using either
pHost->m_pHostperlSock,
pHost->m_pHostperlProc);
if (my_perl) {
- CPerlObj* pPerl = (CPerlObj*)my_perl;
w32_internal_host = pHost;
}
}
#ifndef _INC_WIN32_PERL5
#define _INC_WIN32_PERL5
+#define _WIN32_WINNT 0x0400 /* needed for TryEnterCriticalSection() etc. */
+
#if defined(PERL_OBJECT) || defined(PERL_IMPLICIT_SYS) || defined(PERL_CAPI)
# define DYNAMIC_ENV_FETCH
# define ENV_HV_NAME "___ENV_HV_NAME___"