Disable the built-in preprocessor in cemcom.ansi; the external preprocessor is

always run. Fix a bug in block skipping in the preprocessor.
This commit is contained in:
David Given 2018-09-02 12:39:00 +02:00
parent f8fc5bc3d8
commit 6931ffa5a4
4 changed files with 9 additions and 16 deletions

View file

@ -112,7 +112,7 @@
!File: nopp.h !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 !File: nobitfield.h

View file

@ -16,10 +16,6 @@
#include "input.h" #include "input.h"
#include "replace.h" #include "replace.h"
#ifndef NOPP
#include <alloc.h>
#include "class.h"
#include "macro.h"
#ifdef DBSYMTAB #ifdef DBSYMTAB
#include <stb.h> #include <stb.h>
#include <em.h> #include <em.h>
@ -27,6 +23,12 @@ int IncludeLevel = 0;
#endif #endif
extern char options[]; extern char options[];
#ifndef NOPP
#include <alloc.h>
#include "class.h"
#include "macro.h"
extern char** inctable; /* list of include directories */ extern char** inctable; /* list of include directories */
extern char* getwdir(); extern char* getwdir();
char ifstack[IFDEPTH]; /* if-stack: the content of an entry is */ char ifstack[IFDEPTH]; /* if-stack: the content of an entry is */

View file

@ -187,6 +187,7 @@ void skip_block(to_endif) int to_endif;
} }
if (ch == '/') if (ch == '/')
{ {
ch = GetChar();
if (ch == '*') if (ch == '*')
{ {
skipcomment(); skipcomment();

View file

@ -72,18 +72,8 @@ name cem
mapflag -V* CEM_F={CEM_F?} -V* mapflag -V* CEM_F={CEM_F?} -V*
rts .c rts .c
need .c need .c
prep always
args \ 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} \ -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?} \ {CC_ALIGN?} \
{CEM_F?} {LFLAG?} < > {CEM_F?} {LFLAG?} < >