summaryrefslogtreecommitdiff
path: root/bcc
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2010-07-19 19:26:16 +0200
committerLubomir Rintel <lkundrak@v3.sk>2013-10-29 16:30:52 +0100
commitc507d2f4b685874573fe0bb85a1a3a7d4d32dbd0 (patch)
treecd1fb27ebc2d2fc3e9f4cc95e786e2bbe8c1ae2e /bcc
parenta971aeabb4caf06339d9c53265b034d3cd9349bd (diff)
downloaddev86-c507d2f4b685874573fe0bb85a1a3a7d4d32dbd0.tar.gz
Add -7 option to compiler to enable ancient construct
Following commits add various funcitonality that is likely to be unwanted for the most, but is vital to compile really old C code, such as Seventh Edition UNIX code.
Diffstat (limited to 'bcc')
-rw-r--r--bcc/bcc.c13
-rw-r--r--bcc/gencode.c3
-rw-r--r--bcc/input.c13
-rw-r--r--bcc/parse.h3
4 files changed, 31 insertions, 1 deletions
diff --git a/bcc/bcc.c b/bcc/bcc.c
index 574752c..dc68b46 100644
--- a/bcc/bcc.c
+++ b/bcc/bcc.c
@@ -103,7 +103,11 @@ struct opt_list {
} * options;
int opt_v, opt_V, opt_e, opt_x, opt_I, opt_L, opt_W, opt_i,
- opt_O, opt_M, opt_f;
+ opt_O, opt_M, opt_f
+#ifndef VERY_SMALL_MEMORY
+, opt_7
+#endif
+;
#ifdef DEFARCH
int opt_arch = (DEFARCH != 0);
@@ -392,6 +396,10 @@ struct file_list * file;
if (opt_arch<5 && !do_as)
command_opt("-t");
+#ifndef VERY_SMALL_MEMORY
+ if (opt_7)
+ command_opt("-7");
+#endif
command_opts('c');
command_opts('C');
@@ -956,6 +964,9 @@ char ** argv;
case 'L': opt_L++; break;
case 'i': opt_i++; break;
case 'f': opt_f++; break;
+#ifndef VERY_SMALL_MEMORY
+ case '7': opt_7++; break;
+#endif
case 'W': opt_W++; break;
diff --git a/bcc/gencode.c b/bcc/gencode.c
index 91c524f..6c97e1d 100644
--- a/bcc/gencode.c
+++ b/bcc/gencode.c
@@ -81,6 +81,9 @@ PUBLIC bool_t arg1inreg = TRUE;
PUBLIC store_pt calleemask = INDREG1 | INDREG2;
PUBLIC bool_t callersaves = TRUE;
PUBLIC char *callstring = "JSR\t>";
+#ifndef VERY_SMALL_MEMORY
+PUBLIC bool_t ancient = FALSE;
+#endif
PUBLIC store_pt doubleargregs = DREG | INDREG0 | INDREG1 | INDREG2;
PUBLIC store_pt doubleregs = DREG | INDREG0 | INDREG1 | INDREG2;
PUBLIC store_pt doublreturnregs = DREG | INDREG0 | INDREG1 | INDREG2;
diff --git a/bcc/input.c b/bcc/input.c
index a17af4a..9ef19e3 100644
--- a/bcc/input.c
+++ b/bcc/input.c
@@ -12,6 +12,9 @@
#include "sc.h"
#include "scan.h"
#include "table.h"
+#ifndef VERY_SMALL_MEMORY
+#include "parse.h"
+#endif
#undef EXTERN
#define EXTERN
@@ -539,6 +542,9 @@ char *argv[];
#endif
case 't': /* print source code in asm output */
case 'w': /* watch location counter */
+#ifndef VERY_SMALL_MEMORY
+ case '7': /* accept ancient K&R code */
+#endif
case 'O': /* Optimisation. */
if (arg[2] == 0)
flag[(int)arg[1]] = TRUE;
@@ -631,6 +637,13 @@ ts_s_includelist += sizeof *incnew;
definestring("__POS_INDEPENDENT__");
}
#endif
+#ifndef VERY_SMALL_MEMORY
+ if (flag['7'])
+ {
+ ancient = TRUE;
+ definestring("__ANCIENT__");
+ }
+#endif
if (flag['O'])
{
optimise = TRUE;
diff --git a/bcc/parse.h b/bcc/parse.h
index ab67f6c..429ca2a 100644
--- a/bcc/parse.h
+++ b/bcc/parse.h
@@ -17,3 +17,6 @@ EXTERN struct nodestruct *etptr; /* ptr to next entry in expression tree */
EXTERN struct symstruct *gvarsymptr; /* gsymptr for last identifier declared */
EXTERN scopelev_t level; /* scope level */
/* depends on zero init */
+#ifndef VERY_SMALL_MEMORY
+EXTERN bool_t ancient; /* undersand ancient K&R */
+#endif