From beba34dc223aa0dcf3e5f696966c5e8408b022c3 Mon Sep 17 00:00:00 2001 From: Robert de Bath Date: Sat, 24 Jan 2004 16:27:32 +0100 Subject: Import Dev86src-0.16.15.tar.gz --- bcc/scan.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'bcc/scan.c') diff --git a/bcc/scan.c b/bcc/scan.c index b96093d..36271e4 100644 --- a/bcc/scan.c +++ b/bcc/scan.c @@ -119,6 +119,7 @@ PUBLIC void blanks() continue; reglineptr = lineptr; } +#ifdef BUILTIN_CPP if (*reglineptr != '/') return; if (SYMOFCHAR(*(reglineptr + 1)) == SPECIALCHAR) @@ -131,6 +132,9 @@ PUBLIC void blanks() return; gch1(); skipcomment(); +#else + return; +#endif } } @@ -139,7 +143,9 @@ int asm_only; { int start_of_line = 1; #ifndef ASM_BARE +#ifdef BUILTIN_CPP virtual_nl = 1; +#endif #endif while (!asm_only || asmmode) { @@ -172,6 +178,7 @@ int asm_only; outstr(constant.value.s); /* XXX - embedded null would kill it */ charptr = constant.value.s; break; +#ifdef BUILTIN_CPP case CONTROL: gch1(); if (maclevel != 0) @@ -196,6 +203,12 @@ int asm_only; } outbyte('/'); break; +#else /* !BUILTIN_CPP */ + case CONTROL: + gch1(); + docontrol(); + continue; +#endif case FLOATCONST: gch1(); if (SYMOFCHAR(ch) == INTCONST) @@ -211,6 +224,7 @@ int asm_only; break; case IDENT: getident(); +#ifdef BUILTIN_CPP if ((gsymptr = findlorg(gsname)) != NULL) { if (gsymptr->flags == DEFINITION) @@ -219,6 +233,7 @@ int asm_only; break; } } +#endif outstr(gsname); break; case INTCONST: @@ -253,7 +268,11 @@ int asm_only; /* must be '\\' */ default: /* Allow for multi-instruction lines in asm */ +#ifdef BUILTIN_CPP if( ch == '^' && !orig_cppmode && asmmode ) ch='\n'; +#else + if( ch == '^' && asmmode ) ch='\n'; +#endif OUTBYTE(ch); ch = *++lineptr; @@ -261,7 +280,9 @@ int asm_only; break; } #ifndef ASM_BARE +#ifdef BUILTIN_CPP virtual_nl = 0; +#endif #endif } } @@ -473,12 +494,14 @@ PUBLIC void nextsym() constant.type = itype; return; case CONTROL: +#ifdef BUILTIN_CPP if (maclevel != 0) { error("# in a macro: not preprocessed"); /* XXX? */ return; } else +#endif { int old_asmmode = asmmode; docontrol(); @@ -505,11 +528,13 @@ PUBLIC void nextsym() getident(); if ((gsymptr = findlorg(gsname)) != NULL) { +#ifdef BUILTIN_CPP if (gsymptr->flags == DEFINITION) { entermac(); break; } +#endif if (gsymptr->flags == KEYWORD) sym = gsymptr->offset.offsym; } @@ -609,11 +634,13 @@ PUBLIC void nextsym() } return; case SLASH: +#ifdef BUILTIN_CPP if (ch == '*') { skipcomment(); break; } +#endif if (ch == '=') { sym = DIVABOP; @@ -749,7 +776,9 @@ PUBLIC void stringorcharconst() gch1(); if (ch == EOL) { +#ifdef BUILTIN_CPP if (!orig_cppmode) +#endif eofin("escape sequence"); break; } @@ -758,7 +787,9 @@ PUBLIC void stringorcharconst() GCH1(); if (ch == EOL) { +#ifdef BUILTIN_CPP if (!orig_cppmode && ifcheck() ) +#endif error(terminator == '"' ? "end of line in string constant" : "end of line in character constant"); break; -- cgit v1.2.1