version using input module and detecting preprocessor loops

This commit is contained in:
ceriel
1986-12-04 16:29:44 +00:00
parent 91aad0b28e
commit 53d6dfcb6b
13 changed files with 239 additions and 599 deletions

View File

@@ -5,7 +5,6 @@
#ifndef NOPP
#include <system.h>
#include "predefine.h" /* UF */
#include "alloc.h"
#include "class.h"
#include "macro.h"
@@ -57,10 +56,7 @@ init_pp()
}
/* Initialize __DATE__, __FILE__ and __LINE__ macro
definitions. The compile-time specified predefined macros
are also predefined: if this file is compiled with
-DPREDEFINE="vax,pdp", the macro definitions "vax" and
"pdp" are predefined macros.
definitions.
*/
/* __DATE__ */
clock = sys_time();
@@ -77,33 +73,5 @@ init_pp()
/* defined(??) */
macro_def(str2idf("defined"), "", 1, 1, FUNC);
#ifdef PREDEFINE
{
/* PREDEFINE is a compile-time defined string
containing a number of identifiers to be
predefined at the host machine (for example
-DPREDEFINE="vax,unix,pmds").
*/
register char *s = PREDEFINE;
register char *id;
char c;
for (;;) {
while (*s && class(*s++) != STIDF);
if (*s) {
/* gobble identifier */
id = s - 1;
while (in_idf(*s++));
c = *--s;
*s = '\0';
macro_def(str2idf(id), "1", -1, 1, PREDEF);
*s = c;
}
else
break;
}
}
#endif PREDEFINE
}
#endif NOPP