qt.cfg: Add support for macros `forever` and `Q_FOREVER` (#1662)

Reference:
https://doc.qt.io/qt-5/qtglobal.html#forever
https://doc.qt.io/qt-5/qtglobal.html#Q_FOREVER
This commit is contained in:
Sebastian 2019-02-11 16:35:01 +01:00 committed by GitHub
parent d9241aa532
commit 2c1f97d787
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -1316,6 +1316,7 @@
<define name="Q_ENUM(X)" value=""/>
<define name="Q_ENUMS(X)" value=""/>
<define name="Q_FLAGS(X)" value=""/>
<define name="Q_FOREVER" value="for (;;)"/>
<define name="Q_INTERFACES(X)" value=""/>
<define name="Q_NULLPTR" value="NULL"/>
<define name="Q_OBJECT" value=""/>
@ -1327,6 +1328,7 @@
<define name="QVERIFY(expr)" value="assert( expr )"/>
<define name="QVERIFY2(cond, msg)" value="assert( cond )"/>
<define name="foreach(A,B)" value="for(A:B)"/>
<define name="forever" value="for (;;)"/>
<define name="emit(X)" value="(X)"/>
<define name="Q_PLUGIN_METADATA(x)" value=""/>
<!-- https://doc.qt.io/qt-5/qtglobal.html#qreal-typedef -->

View File

@ -46,6 +46,14 @@ void validCode(int * pIntPtr)
if (pIntPtr != Q_NULLPTR) {
*pIntPtr = 5;
}
if (pIntPtr && *pIntPtr == 1) {
forever {
}
} else if (pIntPtr && *pIntPtr == 2) {
Q_FOREVER {
}
}
}
void ignoredReturnValue()