From: Malcolm Beattie Date: Wed, 3 Sep 1997 12:31:48 +0000 (+0000) Subject: Make compiler build/work with devel 5.005 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ed65db6c6bc1b1e4dbabdf2bae93837e52fa7473;p=p5sagit%2Fp5-mst-13.2.git Make compiler build/work with devel 5.005 p4raw-id: //depot/perlext/Compiler@50 --- diff --git a/B.xs b/B.xs index 4934b06..7d20097 100644 --- a/B.xs +++ b/B.xs @@ -260,6 +260,7 @@ walkoptree(opsv, method) SV *opsv; char *method; { + dTHR; dSP; OP *o; diff --git a/B/Asmdata.pm b/B/Asmdata.pm index bcfa0cc..68e1a07 100644 --- a/B/Asmdata.pm +++ b/B/Asmdata.pm @@ -1,5 +1,5 @@ # -# Copyright (c) 1996 Malcolm Beattie +# Copyright (c) 1996, 1997 Malcolm Beattie # # You may distribute under the terms of either the GNU General Public # License or the Artistic License, as specified in the README file. diff --git a/bytecode.h b/bytecode.h index 2cdc028..0fcaa97 100644 --- a/bytecode.h +++ b/bytecode.h @@ -12,7 +12,9 @@ void *bset_obj_store _((void *, I32)); void freadpv _((U32, void *)); EXT SV *sv; +#ifndef USE_THREADS EXT OP *op; +#endif EXT XPV pv; EXT void **obj_list; @@ -135,14 +137,15 @@ EXT I32 obj_list_fill INIT(-1); #define BSET_hv_store(sv, arg) \ hv_store((HV*)sv, pv.xpv_pv, pv.xpv_cur, arg, 0) #define BSET_pv_free(pv) Safefree(pv.xpv_pv) -#define BSET_pregcomp(op, arg) \ - cPMOP->op_pmregexp = arg ? pregcomp(arg, arg + pv.xpv_cur, cPMOP) : 0 +#define BSET_pregcomp(o, arg) \ + ((PMOP*)o)->op_pmregexp = arg ? \ + pregcomp(arg, arg + pv.xpv_cur, ((PMOP*)o)) : 0 #define BSET_newsv(sv, arg) sv = NEWSV(666,0); SvUPGRADE(sv, arg) -#define BSET_newop(op, arg) op = (OP*)safemalloc(optype_size[arg]) -#define BSET_newopn(op, arg) do { \ - OP *oldop = op; \ - BSET_newop(op, arg); \ - oldop->op_next = op; \ +#define BSET_newop(o, arg) o = (OP*)safemalloc(optype_size[arg]) +#define BSET_newopn(o, arg) do { \ + OP *oldop = o; \ + BSET_newop(o, arg); \ + oldop->op_next = o; \ } while (0) #define BSET_ret(foo) return @@ -151,11 +154,11 @@ EXT I32 obj_list_fill INIT(-1); * Kludge special-case workaround for OP_MAPSTART * which needs the ppaddr for OP_GREPSTART. Blech. */ -#define BSET_op_type(op, arg) do { \ - op->op_type = arg; \ - op->op_ppaddr = (arg != OP_MAPSTART) ? ppaddr[arg] : pp_grepstart; \ +#define BSET_op_type(o, arg) do { \ + o->op_type = arg; \ + o->op_ppaddr = (arg != OP_MAPSTART) ? ppaddr[arg] : pp_grepstart; \ } while (0) -#define BSET_op_ppaddr(op, arg) croak("op_ppaddr not yet implemented") +#define BSET_op_ppaddr(o, arg) croak("op_ppaddr not yet implemented") #define BSET_curpad(pad, arg) pad = AvARRAY(arg) #define BSET_OBJ_STORE(obj, ix) \ diff --git a/bytecode.pl b/bytecode.pl index 0f79e65..f24f379 100644 --- a/bytecode.pl +++ b/bytecode.pl @@ -20,7 +20,7 @@ while (($from, $tos) = each %alias_to) { my $c_header = <<'EOT'; /* - * Copyright (c) 1996 Malcolm Beattie + * Copyright (c) 1996, 1997 Malcolm Beattie * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -84,6 +84,7 @@ void byterun(fp) FILE *fp; #endif /* INDIRECT_BGET_MACROS */ { + dTHR; int insn; while ((insn = FGETC()) != EOF) { switch (insn) { @@ -168,6 +169,13 @@ void byterun _((struct bytestream)); void byterun _((FILE *)); #endif /* INDIRECT_BGET_MACROS */ +#ifndef PATCHLEVEL +#include "patchlevel.h" +#endif +#if PATCHLEVEL < 4 || (PATCHLEVEL == 4 && SUBVERSION < 50) +#define dTHR extern int errno +#endif + enum { EOT diff --git a/byterun.c b/byterun.c index 7eb981e..d478a90 100644 --- a/byterun.c +++ b/byterun.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996 Malcolm Beattie + * Copyright (c) 1996, 1997 Malcolm Beattie * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -22,6 +22,7 @@ void byterun(fp) FILE *fp; #endif /* INDIRECT_BGET_MACROS */ { + dTHR; int insn; while ((insn = FGETC()) != EOF) { switch (insn) { diff --git a/byterun.h b/byterun.h index fee8eda..b8c557c 100644 --- a/byterun.h +++ b/byterun.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996 Malcolm Beattie + * Copyright (c) 1996, 1997 Malcolm Beattie * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -21,6 +21,13 @@ void byterun _((struct bytestream)); void byterun _((FILE *)); #endif /* INDIRECT_BGET_MACROS */ +#ifndef PATCHLEVEL +#include "patchlevel.h" +#endif +#if PATCHLEVEL < 4 || (PATCHLEVEL == 4 && SUBVERSION < 50) +#define dTHR extern int errno +#endif + enum { INSN_RET, /* 0 */ INSN_LDSV, /* 1 */