diff options
author | Robert de Bath <rdebath@poboxes.com> | 2002-01-12 20:42:42 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2013-10-23 23:48:46 +0200 |
commit | d91fa39567f5659e3931cf61517d62fddcd87570 (patch) | |
tree | 20583acd4f345a4f5c9a7772870ef972cb8a3b14 /bcc/preproc.c | |
parent | bff547eabb6678ec8e71ffbcfbf9a4f05c94d949 (diff) | |
download | dev86-d91fa39567f5659e3931cf61517d62fddcd87570.tar.gz |
Import Dev86src-0.16.1.tar.gzv0.16.1
Diffstat (limited to 'bcc/preproc.c')
-rw-r--r-- | bcc/preproc.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/bcc/preproc.c b/bcc/preproc.c index 84262e6..62302e8 100644 --- a/bcc/preproc.c +++ b/bcc/preproc.c @@ -68,8 +68,11 @@ PRIVATE void asmcontrol() #endif asmmode = TRUE; + if (expect_statement) + return; + if (orig_cppmode) - outstr("#asm\n"); + outnstr("#asm"); else { outnstr("!BCC_ASM"); @@ -126,9 +129,9 @@ PRIVATE void asmcontrol() } #endif if (orig_cppmode) - outstr("#endasm"); /* nl is done by skipeol */ + outnstr("#endasm"); else - outstr("!BCC_ENDASM\n"); + outnstr("!BCC_ENDASM"); } /* blanksident() - return nonzero if at blanks followed by an identifier */ @@ -158,6 +161,13 @@ PRIVATE void control() char sname[NAMESIZE + 1]; sym_t ctlcase; struct symstruct *symptr; + if (ctext && asmmode) + { + comment(); + outudec(input.linenumber); + outbyte(' '); + outline(lineptr); + } sname[0] = '#'; /* prepare for bad control */ sname[1] = 0; @@ -188,7 +198,13 @@ PRIVATE void control() switch (ctlcase) { case ASMCNTL: - asmcontrol(); + if (asmmode) + { + if (ifstate.ifflag) + error(" bad control"); + } + else + asmcontrol(); break; case DEFINECNTL: define(); @@ -197,6 +213,11 @@ PRIVATE void control() elsecontrol(); break; case ENDASMCNTL: + if (!asmmode) + { + if (ifstate.ifflag) + error(" bad control"); + } asmmode = FALSE; break; case ENDIFCNTL: |