diff options
author | Nicholas Clark <nick@ccl4.org> | 2004-09-08 16:53:34 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2004-09-08 16:53:34 +0000 |
commit | 7252851f9977dfc5c982b985eeabcb43c006d03e (patch) | |
tree | 714a839aaead2ed6bc3b8c9dae4e2a31b0330f65 /ext/B/B.xs | |
parent | 0c34ef67a6aacb77e2b5421df56439f11f4d78c0 (diff) | |
download | perl-7252851f9977dfc5c982b985eeabcb43c006d03e.tar.gz |
backport B to work on 5.8.x, so that a single version of the source
can be maintained, and ultimately dual-lifed on CPAN
(the version conditional changes are actually surprisingly small)
p4raw-id: //depot/perl@23278
Diffstat (limited to 'ext/B/B.xs')
-rw-r--r-- | ext/B/B.xs | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/ext/B/B.xs b/ext/B/B.xs index ed1af11c7b..43b91fe3be 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -29,11 +29,16 @@ static char *svclassnames[] = { "B::PVNV", "B::PVMG", "B::BM", +#if PERL_VERSION >= 9 "B::GV", +#endif "B::PVLV", "B::AV", "B::HV", "B::CV", +#if PERL_VERSION <= 8 + "B::GV", +#endif "B::FM", "B::IO", }; @@ -416,9 +421,15 @@ oplist(pTHX_ OP *o, SV **SP) { for(; o; o = o->op_next) { SV *opsv; - if (o->op_opt == 0) +#if PERL_VERSION >= 9 + if (o->op_opt == 0) break; o->op_opt = 0; +#else + if (o->op_seq == 0) + break; + o->op_seq = 0; +#endif opsv = sv_newmortal(); sv_setiv(newSVrv(opsv, cc_opclassname(aTHX_ (OP*)o)), PTR2IV(o)); XPUSHs(opsv); @@ -494,6 +505,9 @@ BOOT: specialsv_list[4] = pWARN_ALL; specialsv_list[5] = pWARN_NONE; specialsv_list[6] = pWARN_STD; +#if PERL_VERSION <= 9 +# define CVf_ASSERTION 0 +#endif #include "defsubs.h" } @@ -714,8 +728,12 @@ threadsv_names() #define OP_desc(o) PL_op_desc[o->op_type] #define OP_targ(o) o->op_targ #define OP_type(o) o->op_type -#define OP_opt(o) o->op_opt -#define OP_static(o) o->op_static +#if PERL_VERSION >= 9 +# define OP_opt(o) o->op_opt +# define OP_static(o) o->op_static +#else +# define OP_seq(o) o->op_seq +#endif #define OP_flags(o) o->op_flags #define OP_private(o) o->op_private #define OP_spare(o) o->op_spare @@ -773,6 +791,8 @@ U16 OP_type(o) B::OP o +#if PERL_VERSION >= 9 + U8 OP_opt(o) B::OP o @@ -781,6 +801,14 @@ U8 OP_static(o) B::OP o +#else + +U16 +OP_seq(o) + B::OP o + +#endif + U8 OP_flags(o) B::OP o @@ -789,10 +817,14 @@ U8 OP_private(o) B::OP o +#if PERL_VERSION >= 9 + U8 OP_spare(o) B::OP o +#endif + void OP_oplist(o) B::OP o |