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:
parent
2c1f97d787
commit
8207e48adc
|
@ -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<type >(#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 )"/>
|
||||
|
|
|
@ -54,6 +54,9 @@ void validCode(int * pIntPtr)
|
|||
Q_FOREVER {
|
||||
}
|
||||
}
|
||||
|
||||
if (Q_LIKELY(pIntPtr)) {}
|
||||
if (Q_UNLIKELY(!pIntPtr)) {}
|
||||
}
|
||||
|
||||
void ignoredReturnValue()
|
||||
|
|
Loading…
Reference in New Issue