From 6931ffa5a409461d2c16ce5b0874491975fe1a23 Mon Sep 17 00:00:00 2001 From: David Given Date: Sun, 2 Sep 2018 12:39:00 +0200 Subject: [PATCH] Disable the built-in preprocessor in cemcom.ansi; the external preprocessor is always run. Fix a bug in block skipping in the preprocessor. --- lang/cem/cemcom.ansi/BigPars | 2 +- lang/cem/cemcom.ansi/domacro.c | 10 ++++++---- lang/cem/cpp.ansi/domacro.c | 1 + lib/descr/fe | 12 +----------- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/lang/cem/cemcom.ansi/BigPars b/lang/cem/cemcom.ansi/BigPars index e3fad8296..97965fd16 100644 --- a/lang/cem/cemcom.ansi/BigPars +++ b/lang/cem/cemcom.ansi/BigPars @@ -112,7 +112,7 @@ !File: nopp.h -/*#define NOPP 1 /* if NOT defined, use built-int preprocessor */ +#define NOPP 1 /* if NOT defined, use built-int preprocessor */ !File: nobitfield.h diff --git a/lang/cem/cemcom.ansi/domacro.c b/lang/cem/cemcom.ansi/domacro.c index cce775f64..ee6d25d00 100644 --- a/lang/cem/cemcom.ansi/domacro.c +++ b/lang/cem/cemcom.ansi/domacro.c @@ -16,10 +16,6 @@ #include "input.h" #include "replace.h" -#ifndef NOPP -#include -#include "class.h" -#include "macro.h" #ifdef DBSYMTAB #include #include @@ -27,6 +23,12 @@ int IncludeLevel = 0; #endif extern char options[]; + +#ifndef NOPP +#include +#include "class.h" +#include "macro.h" + extern char** inctable; /* list of include directories */ extern char* getwdir(); char ifstack[IFDEPTH]; /* if-stack: the content of an entry is */ diff --git a/lang/cem/cpp.ansi/domacro.c b/lang/cem/cpp.ansi/domacro.c index 2376173ca..39c2d8482 100644 --- a/lang/cem/cpp.ansi/domacro.c +++ b/lang/cem/cpp.ansi/domacro.c @@ -187,6 +187,7 @@ void skip_block(to_endif) int to_endif; } if (ch == '/') { + ch = GetChar(); if (ch == '*') { skipcomment(); diff --git a/lib/descr/fe b/lib/descr/fe index 189701c96..673270c2d 100644 --- a/lib/descr/fe +++ b/lib/descr/fe @@ -72,18 +72,8 @@ name cem mapflag -V* CEM_F={CEM_F?} -V* rts .c need .c + prep always args \ - {CPP_F?} \ - -D__{ARCH} -D__{PLATFORM} \ - -D__ACK \ - {SYSINCLUDES?} \ - {C_INCLUDES} \ - {INCLUDES?} \ - ({ANSI_C?.xx}:.xx=-D{ARCH} \ - -DEM_WSIZE={w} -DEM_PSIZE={p} \ - -DEM_SSIZE={s} -DEM_LSIZE={l} -DEM_FSIZE={f} -DEM_DSIZE={d}) \ - -D_EM_WSIZE={w} -D_EM_PSIZE={p} \ - -D_EM_SSIZE={s} -D_EM_LSIZE={l} -D_EM_FSIZE={f} -D_EM_DSIZE={d} \ -Vw{w}.{wa}i{w}.{wa}p{p}.{pa}f{f}.{fa}s{s}.{sa}l{l}.{la}d{d}.{da}x{x}.{xa} \ {CC_ALIGN?} \ {CEM_F?} {LFLAG?} < >