From 47358472068516b210ba857379e05bbc9b9b4584 Mon Sep 17 00:00:00 2001 From: Malcolm Beattie Date: Fri, 27 Feb 1998 18:35:27 +0000 Subject: [PATCH] Change FREAD/FGETC to BGET_FREAD/BGET_FGETC to avoid clash with preprocessor symbol on Digital UNIX. p4raw-id: //depot/perl@602 --- bytecode.h | 24 ++++++++++++++---------- bytecode.pl | 2 +- byterun.c | 2 +- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/bytecode.h b/bytecode.h index 7ca7ffd..115fec7 100644 --- a/bytecode.h +++ b/bytecode.h @@ -19,17 +19,21 @@ EXT void **obj_list; EXT I32 obj_list_fill INIT(-1); #ifdef INDIRECT_BGET_MACROS -#define FREAD(argp, len, nelem) bs.fread((char*)(argp),(len),(nelem),bs.data) -#define FGETC() bs.fgetc(bs.data) +#define BGET_FREAD(argp, len, nelem) \ + bs.fread((char*)(argp),(len),(nelem),bs.data) +#define BGET_FGETC() bs.fgetc(bs.data) #else -#define FREAD(argp, len, nelem) fread((argp), (len), (nelem), fp) -#define FGETC() getc(fp) +#define BGET_FREAD(argp, len, nelem) fread((argp), (len), (nelem), fp) +#define BGET_FGETC() getc(fp) #endif /* INDIRECT_BGET_MACROS */ -#define BGET_U32(arg) FREAD(&arg, sizeof(U32), 1); arg = ntohl((U32)arg) -#define BGET_I32(arg) FREAD(&arg, sizeof(I32), 1); arg = (I32)ntohl((U32)arg) -#define BGET_U16(arg) FREAD(&arg, sizeof(U16), 1); arg = ntohs((U16)arg) -#define BGET_U8(arg) arg = FGETC() +#define BGET_U32(arg) \ + BGET_FREAD(&arg, sizeof(U32), 1); arg = ntohl((U32)arg) +#define BGET_I32(arg) \ + BGET_FREAD(&arg, sizeof(I32), 1); arg = (I32)ntohl((U32)arg) +#define BGET_U16(arg) \ + BGET_FREAD(&arg, sizeof(U16), 1); arg = ntohs((U16)arg) +#define BGET_U8(arg) arg = BGET_FGETC() #if INDIRECT_BGET_MACROS #define BGET_PV(arg) do { \ @@ -59,7 +63,7 @@ EXT I32 obj_list_fill INIT(-1); #endif /* INDIRECT_BGET_MACROS */ #define BGET_comment(arg) \ - do { arg = FGETC(); } while (arg != '\n' && arg != EOF) + do { arg = BGET_FGETC(); } while (arg != '\n' && arg != EOF) /* * In the following, sizeof(IV)*4 is just a way of encoding 32 on 64-bit-IV @@ -94,7 +98,7 @@ EXT I32 obj_list_fill INIT(-1); #define BGET_pvcontents(arg) arg = pv.xpv_pv #define BGET_strconst(arg) do { \ - for (arg = tokenbuf; (*arg = FGETC()); arg++) /* nothing */; \ + for (arg = tokenbuf; (*arg = BGET_FGETC()); arg++) /* nothing */; \ arg = tokenbuf; \ } while (0) diff --git a/bytecode.pl b/bytecode.pl index c545f41..4553edf 100644 --- a/bytecode.pl +++ b/bytecode.pl @@ -88,7 +88,7 @@ void byterun(FILE *fp) { dTHR; int insn; - while ((insn = FGETC()) != EOF) { + while ((insn = BGET_FGETC()) != EOF) { switch (insn) { EOT diff --git a/byterun.c b/byterun.c index 57c6620..7c32930 100644 --- a/byterun.c +++ b/byterun.c @@ -34,7 +34,7 @@ void byterun(FILE *fp) { dTHR; int insn; - while ((insn = FGETC()) != EOF) { + while ((insn = BGET_FGETC()) != EOF) { switch (insn) { case INSN_COMMENT: /* 35 */ { -- 1.8.3.1