summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorJan-Arve Saether <jan-arve.saether@nokia.com>2012-09-11 13:16:27 +0200
committerQt by Nokia <qt-info@nokia.com>2012-09-18 03:34:08 +0200
commita95ce12b917681f72e5362992803fad4209008c5 (patch)
tree195f8c9ad9b4a61afd6a2c22b0dbb1a22599215b /src/tools
parent1b569fe4550462fa2226093a72e7383f2d0f5ba2 (diff)
Make qdoc read multiline macros in files with CRLF endings
This caused qdoc for instance to not being able to parse qglobal.h correctly. (On windows, it stopped to parse anything meaningful after the line with this macro:) #define Q_INIT_RESOURCE_EXTERN(name) \ extern int QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); It worked on linux just because on linux a line continuation 'token' is the sequence "\\\n" (on windows it is "\\\r\n") So for files with CRLF line endings, it treated *only* the first line as a macro, potentially causing the subsequent lines to affect the state of the tokenizer. Change-Id: If7c80ee7eb317f2d324ace7ff540ced7c31185dc Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Martin Smith <martin.smith@nokia.com>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/qdoc/tokenizer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tools/qdoc/tokenizer.cpp b/src/tools/qdoc/tokenizer.cpp
index 82effb9bae..f95af6ee82 100644
--- a/src/tools/qdoc/tokenizer.cpp
+++ b/src/tools/qdoc/tokenizer.cpp
@@ -599,8 +599,11 @@ int Tokenizer::getTokenAfterPreprocessor()
}
if (!directive.isEmpty()) {
while (yyCh != EOF && yyCh != '\n') {
- if (yyCh == '\\')
+ if (yyCh == '\\') {
yyCh = getChar();
+ if (yyCh == '\r')
+ yyCh = getChar();
+ }
condition += yyCh;
yyCh = getChar();
}