summaryrefslogtreecommitdiff
path: root/src/qdoc/main.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2017-08-30 11:29:03 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2017-09-27 10:09:40 +0000
commit65d817345faf34cf9e5cc4f203b276de906fd84a (patch)
treee7cf3b58f4b41e7b7a66703c3c6ef2af91ecfd21 /src/qdoc/main.cpp
parent3205ac623262abb677cd55b3043f2f1cc5303933 (diff)
downloadqttools-65d817345faf34cf9e5cc4f203b276de906fd84a.tar.gz
qdoc: skip the system include hack on MS-Win
This is a fix-up for "qdoc: Find the system include path if not provided"; MSVC complained about "definition of dllimport function not allowed" due to the hack's insertion of code to define (rather than just declare) a function in locale.h; so this commit wraps the hack in Task-number: QTBUG-62878 Change-Id: Ic3fe9280b1b4a84ca569f448351f3a751a79caa5 Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/main.cpp')
-rw-r--r--src/qdoc/main.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qdoc/main.cpp b/src/qdoc/main.cpp
index 3534abc0e..c61aef0d1 100644
--- a/src/qdoc/main.cpp
+++ b/src/qdoc/main.cpp
@@ -26,7 +26,7 @@
**
****************************************************************************/
-// There must be no #include before this !
+#ifdef HEINOUS_SYSINC_HACK // There must be no #include before this !
#define setlocale locale_file_name_for_clang_qdoc() { \
static char data[] = __FILE__; \
return data; \
@@ -34,6 +34,7 @@
extern char *setlocale
#include <locale.h>
#undef setlocale
+#endif // HEINOUS_SYSINC_HACK
#include <qglobal.h>
#include <qhashfunctions.h>
@@ -653,6 +654,7 @@ QDocCommandLineParser::QDocCommandLineParser()
addOption(frameworkOption);
}
+#ifdef HEINOUS_SYSINC_HACK
/*!
Return the system include directory used when compiling this file.
*/
@@ -666,6 +668,7 @@ static QByteArray getSystemIncludePath()
return QByteArray();
return QByteArray(raw, slash - raw);
}
+#endif // HEINOUS_SYSINC_HACK
void QDocCommandLineParser::process(const QCoreApplication &app)
{
@@ -715,8 +718,10 @@ void QDocCommandLineParser::process(const QCoreApplication &app)
for (const auto &i : paths)
includesPaths << "-I" << currentDir.absoluteFilePath(i);
auto paths2 = values(includePathSystemOption);
+#ifdef HEINOUS_SYSINC_HACK
if (paths2.isEmpty())
paths2 << QString(getSystemIncludePath());
+#endif // HEINOUS_SYSINC_HACK
for (const auto &i : paths2)
includesPaths << "-isystem" << currentDir.absoluteFilePath(i);
const auto paths3 = values(frameworkOption);