summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-05-04 03:03:56 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-05-04 03:03:56 +0200
commit21a27816e66c8bea33b3ee28221df4b0c6ee9baf (patch)
tree3ef8d87833d30b1bdca80bd62e17b415cc3f9a0b /tools
parent5c3a2a2de9bc8c7d76afbc042f94b388b53ce896 (diff)
parentd3e7101032aa8c870fe4eda8ea5abe5bbfe4712e (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Diffstat (limited to 'tools')
-rw-r--r--tools/dumpcpp/main.cpp15
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;