# ifdef USE_LOCALE_COLLATE
# define VTBL_collxfrm get_vtbl(want_vtbl_collxfrm)
# endif
-# ifdef OVERLOAD
-# define VTBL_amagic get_vtbl(want_vtbl_amagic)
-# define VTBL_amagicelem get_vtbl(want_vtbl_amagicelem)
-# endif
+# define VTBL_amagic get_vtbl(want_vtbl_amagic)
+# define VTBL_amagicelem get_vtbl(want_vtbl_amagicelem)
#else
# define VTBL_sv &PL_vtbl_sv
# define VTBL_env &PL_vtbl_env
# ifdef USE_LOCALE_COLLATE
# define VTBL_collxfrm &PL_vtbl_collxfrm
# endif
-# ifdef OVERLOAD
-# define VTBL_amagic &PL_vtbl_amagic
-# define VTBL_amagicelem &PL_vtbl_amagicelem
-# endif
+# define VTBL_amagic &PL_vtbl_amagic
+# define VTBL_amagicelem &PL_vtbl_amagicelem
#endif
#ifdef PERL_OBJECT
#ifdef USE_LOCALE_COLLATE
else if (v == &PL_vtbl_collxfrm) s = "collxfrm";
#endif
-#ifdef OVERLOAD
else if (v == &PL_vtbl_amagic) s = "amagic";
else if (v == &PL_vtbl_amagicelem) s = "amagicelem";
-#endif
if (s)
dump_indent(level, file, " MG_VIRTUAL = &PL_vtbl_%s\n", s);
else
if (flags & SVf_FAKE) sv_catpv(d, "FAKE,");
if (flags & SVf_READONLY) sv_catpv(d, "READONLY,");
-#ifdef OVERLOAD
if (flags & SVf_AMAGIC) sv_catpv(d, "OVERLOAD,");
-#endif /* OVERLOAD */
if (flags & SVp_IOK) sv_catpv(d, "pIOK,");
if (flags & SVp_NOK) sv_catpv(d, "pNOK,");
if (flags & SVp_POK) sv_catpv(d, "pPOK,");
}
}
break;
-#ifdef OVERLOAD
case 'O':
if (strEQ(name, "OVERLOAD")) {
HV* hv = GvHVn(gv);
hv_magic(hv, gv, 'A');
}
break;
-#endif /* OVERLOAD */
case 'S':
if (strEQ(name, "SIG")) {
HV *hv;
}
#endif /* Microport 2.4 hack */
-#ifdef OVERLOAD
/* Updates and caches the CV's */
bool
}
}
}
-#endif /* OVERLOAD */
-
#define HvLAZYDEL_on(hv) (SvFLAGS(hv) |= SVphv_LAZYDEL)
#define HvLAZYDEL_off(hv) (SvFLAGS(hv) &= ~SVphv_LAZYDEL)
-#ifdef OVERLOAD
-
/* Maybe amagical: */
/* #define HV_AMAGICmb(hv) (SvFLAGS(hv) & (SVpgv_badAM | SVpgv_AM)) */
#define HV_badAMAGIC_off(hv) (SvFLAGS(hv) &= ~SVpgv_badAM)
*/
-#endif /* OVERLOAD */
-
#define Nullhe Null(HE*)
#define HeNEXT(he) (he)->hent_next
#define HeKEY_hek(he) (he)->hent_hek
return 0;
}
-#ifdef OVERLOAD
-
int
magic_setamagic(SV *sv, MAGIC *mg)
{
return 0;
}
-#endif /* OVERLOAD */
int
magic_getnkeys(SV *sv, MAGIC *mg)
*/
#ifndef H_PERL
#define H_PERL 1
-#define OVERLOAD
#ifdef PERL_FOR_X2P
/*
0, 0, 0};
#endif
-#ifdef OVERLOAD
EXT MGVTBL PL_vtbl_amagic = {0, magic_setamagic,
0, 0, magic_setamagic};
EXT MGVTBL PL_vtbl_amagicelem = {0, magic_setamagic,
0, 0, magic_setamagic};
-#endif /* OVERLOAD */
#else /* !DOINIT */
EXT MGVTBL PL_vtbl_collxfrm;
#endif
-#ifdef OVERLOAD
EXT MGVTBL PL_vtbl_amagic;
EXT MGVTBL PL_vtbl_amagicelem;
-#endif /* OVERLOAD */
#endif /* !DOINIT */
-#ifdef OVERLOAD
-
enum {
fallback_amg, abs_amg,
bool__amg, nomethod_amg,
# endif
#endif /* _FASTMATH */
-#endif /* OVERLOAD */
-
#define PERLDB_ALL 0x3f /* No _NONAME, _GOTO */
#define PERLDBf_SUB 0x01 /* Debug sub enter/exit. */
#define PERLDBf_LINE 0x02 /* Keep line #. */
PERLVAR(Gdo_undump, bool) /* -u or dump seen? */
PERLVAR(Gdebug, VOL U32) /* flags given to -D switch */
-
-#ifdef OVERLOAD
-
PERLVAR(Gamagic_generation, long)
-#endif
-
#ifdef USE_LOCALE_COLLATE
PERLVAR(Gcollation_ix, U32) /* Collation generation index */
PERLVAR(Gcollation_name,char *) /* Name of current collation */
PP(pp_not)
{
-#ifdef OVERLOAD
djSP; tryAMAGICunSET(not);
-#endif /* OVERLOAD */
*PL_stack_sp = boolSV(!SvTRUE(*PL_stack_sp));
return NORMAL;
}
Renew(PL_tmps_stack, PL_tmps_max = PL_tmps_ix + (n) + 1, SV*); \
} STMT_END
-#ifdef OVERLOAD
-
#define AMGf_noright 1
#define AMGf_noleft 2
#define AMGf_assign 4
SvREFCNT_dec(tmpRef); \
SvRV(rv)=AMG_CALLun(rv,copy); \
} } STMT_END
-#else
-
-#define tryAMAGICbin(a,b)
-#define tryAMAGICbinSET(a,b)
-#define tryAMAGICun(a)
-#define tryAMAGICunSET(a)
-
-#endif /* OVERLOAD */
#define __attribute__(attr)
#endif
#endif
-#ifdef OVERLOAD
VIRTUAL SV* amagic_call _((SV* left,SV* right,int method,int dir));
VIRTUAL bool Gv_AMupdate _((HV* stash));
-#endif /* OVERLOAD */
VIRTUAL OP* append_elem _((I32 optype, OP* head, OP* tail));
VIRTUAL OP* append_list _((I32 optype, LISTOP* first, LISTOP* last));
VIRTUAL I32 apply _((I32 type, SV** mark, SV** sp));
VIRTUAL U32 magic_regdata_cnt _((SV* sv, MAGIC* mg));
VIRTUAL int magic_regdatum_get _((SV* sv, MAGIC* mg));
VIRTUAL int magic_set _((SV* sv, MAGIC* mg));
-#ifdef OVERLOAD
VIRTUAL int magic_setamagic _((SV* sv, MAGIC* mg));
-#endif /* OVERLOAD */
VIRTUAL int magic_setarylen _((SV* sv, MAGIC* mg));
VIRTUAL int magic_setbm _((SV* sv, MAGIC* mg));
VIRTUAL int magic_setdbline _((SV* sv, MAGIC* mg));
}
if (SvTHINKFIRST(sv)) {
if (SvROK(sv)) {
-#ifdef OVERLOAD
SV* tmpstr;
if (SvAMAGIC(sv) && (tmpstr=AMG_CALLun(sv, numer)))
- return SvIV(tmpstr);
-#endif /* OVERLOAD */
+ return SvIV(tmpstr);
return (IV)SvRV(sv);
}
if (SvREADONLY(sv)) {
}
if (SvTHINKFIRST(sv)) {
if (SvROK(sv)) {
-#ifdef OVERLOAD
SV* tmpstr;
if (SvAMAGIC(sv) && (tmpstr=AMG_CALLun(sv, numer)))
- return SvUV(tmpstr);
-#endif /* OVERLOAD */
+ return SvUV(tmpstr);
return (UV)SvRV(sv);
}
if (SvREADONLY(sv)) {
}
if (SvTHINKFIRST(sv)) {
if (SvROK(sv)) {
-#ifdef OVERLOAD
SV* tmpstr;
if (SvAMAGIC(sv) && (tmpstr=AMG_CALLun(sv,numer)))
- return SvNV(tmpstr);
-#endif /* OVERLOAD */
+ return SvNV(tmpstr);
return (double)(unsigned long)SvRV(sv);
}
if (SvREADONLY(sv)) {
}
if (SvTHINKFIRST(sv)) {
if (SvROK(sv)) {
-#ifdef OVERLOAD
SV* tmpstr;
if (SvAMAGIC(sv) && (tmpstr=AMG_CALLun(sv,string)))
- return SvPV(tmpstr,*lp);
-#endif /* OVERLOAD */
+ return SvPV(tmpstr,*lp);
sv = (SV*)SvRV(sv);
if (!sv)
s = "NULLREF";
if (!SvOK(sv))
return 0;
if (SvROK(sv)) {
-#ifdef OVERLOAD
- {
dTHR;
SV* tmpsv;
if (SvAMAGIC(sv) && (tmpsv = AMG_CALLun(sv,bool_)))
- return SvTRUE(tmpsv);
- }
-#endif /* OVERLOAD */
+ return SvTRUE(tmpsv);
return SvRV(sv) != 0;
}
if (SvPOKp(sv)) {
dtype = SvTYPE(dstr);
}
-#ifdef OVERLOAD
SvAMAGIC_off(dstr);
-#endif /* OVERLOAD */
+
/* There's a lot of redundancy below but we're going for speed here */
switch (stype) {
(void)SvIOK_on(dstr);
SvIVX(dstr) = SvIVX(sstr);
}
-#ifdef OVERLOAD
if (SvAMAGIC(sstr)) {
SvAMAGIC_on(dstr);
}
-#endif /* OVERLOAD */
}
else if (sflags & SVp_POK) {
case 0:
mg->mg_virtual = &PL_vtbl_sv;
break;
-#ifdef OVERLOAD
case 'A':
mg->mg_virtual = &PL_vtbl_amagic;
break;
case 'c':
mg->mg_virtual = 0;
break;
-#endif /* OVERLOAD */
case 'B':
mg->mg_virtual = &PL_vtbl_bm;
break;
}
if (SvROK(sv)) {
IV i;
-#ifdef OVERLOAD
- if (SvAMAGIC(sv) && AMG_CALLun(sv,inc)) return;
-#endif /* OVERLOAD */
+ if (SvAMAGIC(sv) && AMG_CALLun(sv,inc))
+ return;
i = (IV)SvRV(sv);
sv_unref(sv);
sv_setiv(sv, i);
}
if (SvROK(sv)) {
IV i;
-#ifdef OVERLOAD
- if (SvAMAGIC(sv) && AMG_CALLun(sv,dec)) return;
-#endif /* OVERLOAD */
+ if (SvAMAGIC(sv) && AMG_CALLun(sv,dec))
+ return;
i = (IV)SvRV(sv);
sv_unref(sv);
sv_setiv(sv, i);
SvFLAGS(sv) = 0;
SV_CHECK_THINKFIRST(rv);
-#ifdef OVERLOAD
SvAMAGIC_off(rv);
-#endif /* OVERLOAD */
if (SvTYPE(rv) < SVt_RV)
sv_upgrade(rv, SVt_RV);
(void)SvUPGRADE(tmpRef, SVt_PVMG);
SvSTASH(tmpRef) = (HV*)SvREFCNT_inc(stash);
-#ifdef OVERLOAD
if (Gv_AMG(stash))
SvAMAGIC_on(sv);
else
SvAMAGIC_off(sv);
-#endif /* OVERLOAD */
return sv;
}
#define SVf_OK (SVf_IOK|SVf_NOK|SVf_POK|SVf_ROK| \
SVp_IOK|SVp_NOK|SVp_POK)
-#ifdef OVERLOAD
-#define SVf_AMAGIC 0x10000000 /* has magical overloaded methods */
-#else
-#define SVf_AMAGIC 0 /* can be or-ed without effect */
-#endif /* OVERLOAD */
+#define SVf_AMAGIC 0x10000000 /* has magical overloaded methods */
#define PRIVSHIFT 8
#define SvRMAGICAL_on(sv) (SvFLAGS(sv) |= SVs_RMG)
#define SvRMAGICAL_off(sv) (SvFLAGS(sv) &= ~SVs_RMG)
-#ifdef OVERLOAD
-#define SvAMAGIC(sv) (SvFLAGS(sv) & SVf_AMAGIC)
-#define SvAMAGIC_on(sv) (SvFLAGS(sv) |= SVf_AMAGIC)
-#define SvAMAGIC_off(sv) (SvFLAGS(sv) &= ~SVf_AMAGIC)
+#define SvAMAGIC(sv) (SvFLAGS(sv) & SVf_AMAGIC)
+#define SvAMAGIC_on(sv) (SvFLAGS(sv) |= SVf_AMAGIC)
+#define SvAMAGIC_off(sv) (SvFLAGS(sv) &= ~SVf_AMAGIC)
/*
#define Gv_AMG(stash) \
((!HV_AMAGICbad(stash) && HV_AMAGIC(stash)) || Gv_AMupdate(stash)))
*/
#define Gv_AMG(stash) (PL_amagic_generation && Gv_AMupdate(stash))
-#endif /* OVERLOAD */
#define SvTHINKFIRST(sv) (SvFLAGS(sv) & SVf_THINKFIRST)