qt.cfg: Add support for macros Q_LIKELY and Q_UNLIKELY

Reference:
https://doc.qt.io/qt-5/qtglobal.html#Q_LIKELY
https://doc.qt.io/qt-5/qtglobal.html#Q_UNLIKELY
This commit is contained in:
versat 2019-02-12 08:21:49 +01:00
parent 2c1f97d787
commit 8207e48adc
2 changed files with 5 additions and 0 deletions

View File

@ -1318,11 +1318,13 @@
<define name="Q_FLAGS(X)" value=""/>
<define name="Q_FOREVER" value="for (;;)"/>
<define name="Q_INTERFACES(X)" value=""/>
<define name="Q_LIKELY(expr)" value="expr"/>
<define name="Q_NULLPTR" value="NULL"/>
<define name="Q_OBJECT" value=""/>
<define name="Q_PROPERTY(X)" value=""/>
<define name="Q_Q(Class)" value="Class * const q = q_func()"/>
<define name="Q_RETURN_ARG(type, data)" value="QReturnArgument&lt;type &gt;(#type, data)"/>
<define name="Q_UNLIKELY(expr)" value="expr"/>
<define name="Q_UNUSED(X)" value="(void)X;"/>
<define name="QCOMPARE(a,b)" value="assert( (a) == (b) )"/>
<define name="QVERIFY(expr)" value="assert( expr )"/>

View File

@ -54,6 +54,9 @@ void validCode(int * pIntPtr)
Q_FOREVER {
}
}
if (Q_LIKELY(pIntPtr)) {}
if (Q_UNLIKELY(!pIntPtr)) {}
}
void ignoredReturnValue()