From a95ce12b917681f72e5362992803fad4209008c5 Mon Sep 17 00:00:00 2001 From: Jan-Arve Saether Date: Tue, 11 Sep 2012 13:16:27 +0200 Subject: 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 Reviewed-by: Oswald Buddenhagen Reviewed-by: Martin Smith --- src/tools/qdoc/tokenizer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/tools') 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(); } -- cgit v1.2.3