summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1998-02-27 18:35:27 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1998-02-27 18:35:27 +0000
commit47358472068516b210ba857379e05bbc9b9b4584 (patch)
treefc0e540f209fa53120d9fba6ca9960c9f9cc28fd
parent83b0a0109e1eed27ea70e7f37c84621d166a32ce (diff)
downloadperl-47358472068516b210ba857379e05bbc9b9b4584.tar.gz
Change FREAD/FGETC to BGET_FREAD/BGET_FGETC to avoid clash with
preprocessor symbol on Digital UNIX. p4raw-id: //depot/perl@602
-rw-r--r--bytecode.h24
-rw-r--r--bytecode.pl2
-rw-r--r--byterun.c2
3 files changed, 16 insertions, 12 deletions
diff --git a/bytecode.h b/bytecode.h
index 7ca7ffd3ac..115fec73de 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 c545f4136d..4553edf9bc 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 57c662009a..7c32930a6a 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 */
{