case SVt_PVGV:
if (GvINTRO(sv)) sv_catpv(d, "INTRO,");
if (GvMULTI(sv)) sv_catpv(d, "MULTI,");
- if (GvSHARED(sv)) sv_catpv(d, "SHARED,");
+ if (GvUNIQUE(sv)) sv_catpv(d, "UNIQUE,");
if (GvASSUMECV(sv)) sv_catpv(d, "ASSUMECV,");
if (GvIN_PAD(sv)) sv_catpv(d, "IN_PAD,");
if (flags & SVpad_OUR) sv_catpv(d, "OUR,");
if (!gv || SvTYPE((SV*)gv) != SVt_PVGV)
Perl_croak(aTHX_ "Bad symbol for filehandle");
if (!GvIOp(gv)) {
-#ifdef GV_SHARED_CHECK
- if (GvSHARED(gv)) {
- Perl_croak(aTHX_ "Bad symbol for filehandle (GV is shared)");
+#ifdef GV_UNIQUE_CHECK
+ if (GvUNIQUE(gv)) {
+ Perl_croak(aTHX_ "Bad symbol for filehandle (GV is unique)");
}
#endif
GvIOp(gv) = newIO();
/* XXX: all GvFLAGS options are used, borrowing GvGPFLAGS for the moment */
-#define GVf_SHARED 0x0001
-#define GvSHARED(gv) (GvGP(gv) && (GvGPFLAGS(gv) & GVf_SHARED))
-#define GvSHARED_on(gv) (GvGPFLAGS(gv) |= GVf_SHARED)
-#define GvSHARED_off(gv) (GvGPFLAGS(gv) &= ~GVf_SHARED)
+#define GVf_UNIQUE 0x0001
+#define GvUNIQUE(gv) (GvGP(gv) && (GvGPFLAGS(gv) & GVf_UNIQUE))
+#define GvUNIQUE_on(gv) (GvGPFLAGS(gv) |= GVf_UNIQUE)
+#define GvUNIQUE_off(gv) (GvGPFLAGS(gv) &= ~GVf_UNIQUE)
#ifdef USE_ITHREADS
-#define GV_SHARED_CHECK
+#define GV_UNIQUE_CHECK
#else
-#undef GV_SHARED_CHECK
+#undef GV_UNIQUE_CHECK
#endif
#define Nullgv Null(GV*)
cv = (!name || GvCVGEN(gv)) ? Nullcv : GvCV(gv);
-#ifdef GV_SHARED_CHECK
- if (cv && GvSHARED(gv) && SvREADONLY(cv)) {
- Perl_croak(aTHX_ "Can't define subroutine %s (GV is shared)", name);
+#ifdef GV_UNIQUE_CHECK
+ if (cv && GvUNIQUE(gv) && SvREADONLY(cv)) {
+ Perl_croak(aTHX_ "Can't define subroutine %s (GV is unique)", name);
}
#endif
if (cv) {
bool exists = CvROOT(cv) || CvXSUB(cv);
-#ifdef GV_SHARED_CHECK
- if (exists && GvSHARED(gv)) {
- Perl_croak(aTHX_ "Can't redefine shared subroutine %s", name);
+#ifdef GV_UNIQUE_CHECK
+ if (exists && GvUNIQUE(gv)) {
+ Perl_croak(aTHX_ "Can't redefine unique subroutine %s", name);
}
#endif
else
name = "STDOUT";
gv = gv_fetchpv(name,TRUE, SVt_PVFM);
-#ifdef GV_SHARED_CHECK
- if (GvSHARED(gv)) {
- Perl_croak(aTHX_ "Bad symbol for form (GV is shared)");
+#ifdef GV_UNIQUE_CHECK
+ if (GvUNIQUE(gv)) {
+ Perl_croak(aTHX_ "Bad symbol for form (GV is unique)");
}
#endif
GvMULTI_on(gv);
methname = "TIEARRAY";
break;
case SVt_PVGV:
-#ifdef GV_SHARED_CHECK
- if (GvSHARED((GV*)varsv)) {
- Perl_croak(aTHX_ "Attempt to tie shared GV");
+#ifdef GV_UNIQUE_CHECK
+ if (GvUNIQUE((GV*)varsv)) {
+ Perl_croak(aTHX_ "Attempt to tie unique GV");
}
#endif
methname = "TIEHANDLE";
Perl_croak(aTHX_ "Can't redefine active sort subroutine %s",
GvNAME(dstr));
-#ifdef GV_SHARED_CHECK
- if (GvSHARED((GV*)dstr)) {
+#ifdef GV_UNIQUE_CHECK
+ if (GvUNIQUE((GV*)dstr)) {
Perl_croak(aTHX_ PL_no_modify);
}
#endif
SV *dref = 0;
int intro = GvINTRO(dstr);
-#ifdef GV_SHARED_CHECK
- if (GvSHARED((GV*)dstr)) {
+#ifdef GV_UNIQUE_CHECK
+ if (GvUNIQUE((GV*)dstr)) {
Perl_croak(aTHX_ PL_no_modify);
}
#endif
SV *sv = &PL_sv_no; /* just need SvREADONLY-ness */
if (GvIO(gv) || GvFORM(gv)) {
- GvSHARED_off(gv); /* GvIOs cannot be shared. nor can GvFORMs */
+ GvUNIQUE_off(gv); /* GvIOs cannot be shared. nor can GvFORMs */
}
else if (!GvCV(gv)) {
GvCV(gv) = (CV*)sv;
else {
/* CvPADLISTs cannot be shared */
if (!CvXSUB(GvCV(gv))) {
- GvSHARED_off(gv);
+ GvUNIQUE_off(gv);
}
}
- if (!GvSHARED(gv)) {
+ if (!GvUNIQUE(gv)) {
#if 0
PerlIO_printf(Perl_debug_log, "gv_share: unable to share %s::%s\n",
HvNAME(GvSTASH(gv)), GvNAME(gv));
LvTYPE(dstr) = LvTYPE(sstr);
break;
case SVt_PVGV:
- if (GvSHARED((GV*)sstr)) {
+ if (GvUNIQUE((GV*)sstr)) {
SV *share;
if ((share = gv_share(sstr))) {
del_SV(dstr);
CvMETHOD_on(PL_compcv);
#ifdef USE_ITHREADS
else if (PL_in_my == KEY_our && len == 6 && strnEQ(s, "unique", len))
- GvSHARED_on(cGVOPx_gv(yylval.opval));
+ GvUNIQUE_on(cGVOPx_gv(yylval.opval));
#endif
/* After we've set the flags, it could be argued that
we don't need to do the attributes.pm-based setting
case 's':
if (strEQ(name, "unique")) {
if (negated)
- GvSHARED_off(CvGV((CV*)sv));
+ GvUNIQUE_off(CvGV((CV*)sv));
else
- GvSHARED_on(CvGV((CV*)sv));
+ GvUNIQUE_on(CvGV((CV*)sv));
continue;
}
break;
switch (*name) {
case 's':
if (strEQ(name, "unique")) {
- /* toke.c has already marked as GvSHARED */
+ /* toke.c has already marked as GVf_UNIQUE */
continue;
}
}
#endif
if (cvflags & CVf_METHOD)
XPUSHs(sv_2mortal(newSVpvn("method", 6)));
- if (GvSHARED(CvGV((CV*)sv)))
+ if (GvUNIQUE(CvGV((CV*)sv)))
XPUSHs(sv_2mortal(newSVpvn("unique", 6)));
break;
default: