X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=bytecode.pl;h=2e3f9c6086d6637a4fcb5871dd3118b3d9940b51;hb=dc45a647708b6c5442e1362e6b6e7a2583c30346;hp=e72d852c32ca7afcbc9ba69f9a9f7a26f974021e;hpb=33b839e22819d9ddfd0fa565289e5af7b6262ec9;p=p5sagit%2Fp5-mst-13.2.git diff --git a/bytecode.pl b/bytecode.pl index e72d852..2e3f9c6 100644 --- a/bytecode.pl +++ b/bytecode.pl @@ -65,18 +65,30 @@ print BYTERUN_C $c_header, <<'EOT'; #include "EXTERN.h" #include "perl.h" -#include "bytecode.h" -#include "byterun.h" + +void * +bset_obj_store(void *obj, I32 ix) +{ + if (ix > obj_list_fill) { + if (obj_list_fill == -1) + New(666, obj_list, ix + 1, void*); + else + Renew(obj_list, ix + 1, void*); + obj_list_fill = ix; + } + obj_list[ix] = obj; + return obj; +} #ifdef INDIRECT_BGET_MACROS void byterun(struct bytestream bs) #else -void byterun(FILE *fp) +void byterun(PerlIO *fp) #endif /* INDIRECT_BGET_MACROS */ { dTHR; int insn; - while ((insn = FGETC()) != EOF) { + while ((insn = BGET_FGETC()) != EOF) { switch (insn) { EOT @@ -153,18 +165,12 @@ struct bytestream { int (*fread)(char *, size_t, size_t, void*); void (*freadpv)(U32, void*); }; -void freadpv _((U32, void *)); void byterun _((struct bytestream)); #else -void byterun _((FILE *)); +void byterun _((PerlIO *)); #endif /* INDIRECT_BGET_MACROS */ -#ifndef PATCHLEVEL -#include "patchlevel.h" -#endif -#if PATCHLEVEL < 4 || (PATCHLEVEL == 4 && SUBVERSION < 50) -#define dTHR extern int errno -#endif +void *bset_obj_store _((void *, I32)); enum { EOT