OSDN Git Service

partitial backport of Q_UNREACHABLE()
authorIvailo Monev <xakepa10@laimg.moc>
Sun, 21 Aug 2016 00:25:56 +0000 (00:25 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Sun, 21 Aug 2016 00:25:56 +0000 (00:25 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/core/global/qglobal.h.cmake

index ef7469f..0d598f9 100644 (file)
@@ -2486,6 +2486,11 @@ inline const QForeachContainer<T> *qForeachContainer(const QForeachContainerBase
 #  endif
 #endif
 
+#define Q_UNREACHABLE() \
+    do {\
+        Q_ASSERT_X(false, "Q_UNREACHABLE()", "Q_UNREACHABLE was reached");\
+    } while (0)
+
 #if 0
 /* tell gcc to use its built-in methods for some common functions */
 #if defined(QT_NO_DEBUG) && defined(Q_CC_GNU)