diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-05-04 03:03:56 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-05-04 03:03:56 +0200 |
commit | 21a27816e66c8bea33b3ee28221df4b0c6ee9baf (patch) | |
tree | 3ef8d87833d30b1bdca80bd62e17b415cc3f9a0b /tools | |
parent | 5c3a2a2de9bc8c7d76afbc042f94b388b53ce896 (diff) | |
parent | d3e7101032aa8c870fe4eda8ea5abe5bbfe4712e (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ibfc5e4ce50bd3392567b6d3f3d00c1062a2d9149
Diffstat (limited to 'tools')
-rw-r--r-- | tools/dumpcpp/main.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/dumpcpp/main.cpp b/tools/dumpcpp/main.cpp index 4601aef..eb6f70a 100644 --- a/tools/dumpcpp/main.cpp +++ b/tools/dumpcpp/main.cpp @@ -935,6 +935,19 @@ static QByteArrayList vTableOnlyStubsFromTypeLib(ITypeLib *typelib, const QStrin return result; } +static void writeForwardDeclaration(QTextStream &declOut, const QByteArray &className) +{ + if (className.startsWith("enum ")) { + declOut << "#ifndef Q_CC_MINGW\n" + << " " << className << ';' << endl // Only MSVC accepts this + << "#else\n" + << " " << className << " {};" << endl + << "#endif\n"; + } else { + declOut << " " << className << ';' << endl; + } +} + bool generateTypeLibrary(QString typeLibFile, QString outname, const QString &nameSpace, ObjectCategories category) { @@ -1116,7 +1129,7 @@ bool generateTypeLibrary(QString typeLibFile, QString outname, for (int c = 0; c < classList.count(); ++c) { QByteArray className = classList.at(c); if (className.contains(' ')) { - declOut << " " << className << ';' << endl; + writeForwardDeclaration(declOut, className); namespaceForType.insert(className.mid(className.indexOf(' ') + 1), nspace); } else { declOut << " class " << className << ';' << endl; |