diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2010-09-10 06:08:45 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2010-09-10 06:08:45 +0000 |
commit | 122bc852f98500360c9d7d920bf3bee220085770 (patch) | |
tree | d52d2337dbc92cb57bc692e39d7215a33d9af9c9 /Source/Preprocessor | |
parent | f6cd7912e324cdf2633a3e4e0c626a26f627be96 (diff) | |
download | swig-122bc852f98500360c9d7d920bf3bee220085770.tar.gz |
Fix #2149523 - Incorrect line number reporting in errors after parsing macros. Remove extraneous extra line in preprocessed output which would sometimes lead to error/warning messages two lines after the end of the file
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12211 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Source/Preprocessor')
-rw-r--r-- | Source/Preprocessor/cpp.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Source/Preprocessor/cpp.c b/Source/Preprocessor/cpp.c index b4866ee9c..bb56c21d2 100644 --- a/Source/Preprocessor/cpp.c +++ b/Source/Preprocessor/cpp.c @@ -1445,15 +1445,14 @@ String *Preprocessor_parse(String *s) { state = 43; } break; - case 46: + case 46: /* in C++ comment */ if (c == '\n') { Ungetc(c, s); - cpp_lines++; state = 50; } else Putc(c, comment); break; - case 47: + case 47: /* in C comment */ if (c == '*') state = 48; else @@ -1638,7 +1637,7 @@ String *Preprocessor_parse(String *s) { } s2 = Preprocessor_parse(s1); addline(ns, s2, allow); - Append(ns, "\n]"); + Append(ns, "]"); if (dirname) { Swig_pop_directory(); } @@ -1784,7 +1783,7 @@ String *Preprocessor_parse(String *s) { pop_imported(); } addline(ns, s2, allow); - Append(ns, "\n]"); + Append(ns, "]"); Delete(s2); Delete(s1); } @@ -1845,7 +1844,6 @@ String *Preprocessor_parse(String *s) { Seek(value, 0, SEEK_SET); Preprocessor_define(value, 1); } - /* Putc('\n',ns); */ addline(ns, value, 0); state = 0; } @@ -1884,6 +1882,5 @@ String *Preprocessor_parse(String *s) { Delete(comment); Delete(chunk); - /* fprintf(stderr,"cpp: %d\n", Len(Getattr(cpp,"symbols"))); */ return ns; } |