diff --git a/src/cpp.c b/src/cpp.c index d1aa74742af92be652edc05bbfe7b93df4726bca..e049f8931cb7cde73220fc05c8fe5335e52a412a 100644 --- a/src/cpp.c +++ b/src/cpp.c @@ -5,7 +5,7 @@ \*/ /* - * $Id: cpp.c,v 1.65 2000/06/13 21:39:34 hubbe Exp $ + * $Id: cpp.c,v 1.66 2000/06/16 15:37:10 lange Exp $ */ #include "global.h" #include "stralloc.h" @@ -208,6 +208,25 @@ static void simple_add_define(struct cpp *this, break; \ } } while(0) +#define FIND_END_OF_STRING2() do { \ + while(1) \ + { \ + if(pos>=len) \ + { \ + cpp_error(this,"End of file in string."); \ + break; \ + } \ + switch(data[pos++]) \ + { \ + case '\n': \ + this->current_line++; \ + continue; \ + case '"': break; \ + case '\\': if(data[++pos]=='\n') this->current_line++; \ + default: continue; \ + } \ + break; \ + } } while(0) #define FIND_END_OF_CHAR() do { \ int e=0; \ diff --git a/src/preprocessor.h b/src/preprocessor.h index 73b684a6e1975d5b63e0a5fa0e27bab832acc3a1..d28b630616d2b971468d3307f6692e95ee4a51ab 100644 --- a/src/preprocessor.h +++ b/src/preprocessor.h @@ -1,5 +1,5 @@ /* - * $Id: preprocessor.h,v 1.24 2000/06/13 21:39:34 hubbe Exp $ + * $Id: preprocessor.h,v 1.25 2000/06/16 15:37:11 lange Exp $ * * Preprocessor template. * Based on cpp.c 1.45 @@ -923,9 +923,13 @@ static INT32 lower_cpp(struct cpp *this, default: continue; case '"': - FIND_END_OF_STRING(); + if(data[pos-2]!='#') { + FIND_END_OF_STRING(); + }else{ + FIND_END_OF_STRING2(); /* Newlines allowed */ + } continue; - + case '\'': FIND_END_OF_CHAR(); continue;