BSD 4_3_Tahoe release
[unix-history] / usr / src / lib / cpp / cpp.c
index 9029a4f..c0079dd 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)cpp.c      1.14 4/27/86";
+static char sccsid[] = "@(#)cpp.c      1.17 10/22/87";
 #endif lint
 
 #ifdef FLEXNAMES
 #endif lint
 
 #ifdef FLEXNAMES
@@ -8,6 +8,7 @@ static char sccsid[] = "@(#)cpp.c       1.14 4/27/86";
 #define        NCPS    8
 #endif
 
 #define        NCPS    8
 #endif
 
+# include "sys/param.h"
 # include "stdio.h"
 # include "ctype.h"
 /* C command
 # include "stdio.h"
 # include "ctype.h"
 /* C command
@@ -34,7 +35,7 @@ char cinit;
 
 /* some code depends on whether characters are sign or zero extended */
 /*     #if '\377' < 0          not used here, old cpp doesn't understand */
 
 /* some code depends on whether characters are sign or zero extended */
 /*     #if '\377' < 0          not used here, old cpp doesn't understand */
-#if pdp11 | vax | mc68000
+#if pdp11 | vax | mc68000 | tahoe
 #define COFF 128
 #else
 #define COFF 0
 #define COFF 128
 #else
 #define COFF 0
@@ -968,10 +969,10 @@ subst(p,sp) register char *p; struct symtab *sp; {
        dump();
        if (sp==ulnloc) {
                vp=acttxt; *vp++='\0';
        dump();
        if (sp==ulnloc) {
                vp=acttxt; *vp++='\0';
-               sprintf(vp,"%d",lineno[ifno]); while (*vp++);
+               (void)sprintf(vp,"%d",lineno[ifno]); while (*vp++);
        } else if (sp==uflloc) {
                vp=acttxt; *vp++='\0';
        } else if (sp==uflloc) {
                vp=acttxt; *vp++='\0';
-               sprintf(vp,"\"%s\"",fnames[ifno]); while (*vp++);
+               (void)sprintf(vp,"\"%s\"",fnames[ifno]); while (*vp++);
        }
        if (0!=(params= *--vp&0xFF)) {/* definition calls for params */
                register char **pa;
        }
        if (0!=(params= *--vp&0xFF)) {/* definition calls for params */
                register char **pa;
@@ -1241,36 +1242,7 @@ main(argc,argv)
 # if unix
        ysysloc=stsym("unix");
 # endif
 # if unix
        ysysloc=stsym("unix");
 # endif
-# if gcos
-       ysysloc=stsym ("gcos");
-# endif
-# if ibm
-       ysysloc=stsym ("ibm");
-# endif
-# if pdp11
-       varloc=stsym("pdp11");
-# endif
-# if vax
-       varloc=stsym("vax");
-# endif
-# if interdata
-       varloc=stsym ("interdata");
-# endif
-# if tss
-       varloc=stsym ("tss");
-# endif
-# if os
-       varloc=stsym ("os");
-# endif
-# if mert
-       varloc=stsym ("mert");
-# endif
-# if mc68000
-       varloc=stsym("mc68000");
-# endif
-# if sun
-       varloc=stsym("sun");
-# endif
+       ysysloc=stsym(MACHINE);
        ulnloc=stsym ("__LINE__");
        uflloc=stsym ("__FILE__");
 
        ulnloc=stsym ("__LINE__");
        uflloc=stsym ("__FILE__");