From 9532543ca99c13febfc24eb845ae13c73786ce07 Mon Sep 17 00:00:00 2001 From: borutr Date: Fri, 31 Oct 2003 12:30:40 +0000 Subject: [PATCH] * support\cpp2\cpplex.c: fixed for SDCPP: comments(when executed with -C option) and _asm blocks were included even if they where in skipped #if block. Applied solution from GCC cpp 3.3.2 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2973 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 7 +++++++ support/cpp2/cpplex.c | 9 +++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index eaae861c..5007681f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-10-31 Borut Razem + + * support\cpp2\cpplex.c: fixed for SDCPP: + comments(when executed with -C option) and _asm blocks + were included even if they where in skipped #if block. + Applied solution from GCC cpp 3.3.2 + 2003-10-31 Borut Razem * src/SDCC.lex: sdcc now understands both formats: diff --git a/support/cpp2/cpplex.c b/support/cpp2/cpplex.c index c174648c..9fbe6e6d 100644 --- a/support/cpp2/cpplex.c +++ b/support/cpp2/cpplex.c @@ -1066,8 +1066,6 @@ _cpp_lex_token (pfile, result) skip_asm_block (pfile); /* Save the _asm block as a token in its own right. */ save_asm (pfile, result, comment_start); - /* Don't do MI optimisation. */ - return; } /* Convert named operators to their proper types. */ else if (result->val.node->flags & NODE_OPERATOR) @@ -1135,8 +1133,11 @@ _cpp_lex_token (pfile, result) /* Save the comment as a token in its own right. */ save_comment (pfile, result, comment_start); - /* Don't do MI optimisation. */ - return; + /* fixed for SDCPP: + when executed with -C option, comments + were included even if they where in skipped #if block. + Applied solution from GCC cpp 3.3.2 */ + break; case '<': if (pfile->state.angled_headers) -- 2.47.2