From ad81f75429f6c5586d667880f90f4a425f1ce968 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 31 Dec 2011 00:15:06 -0200 Subject: Add macros for assuming and unreachable code Use these macros to tell the compiler about conditions that may happen, so it will generate better code. But do not assume that they will do anything special. Change-Id: I89ec4f65f48a9340ccf5ffc4ae4b8c3d8897c8b1 Reviewed-by: Oswald Buddenhagen Reviewed-by: Olivier Goffart --- src/corelib/global/qglobal.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/corelib/global/qglobal.h') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 734177638c..7d91fa3ca9 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -163,6 +163,12 @@ namespace QT_NAMESPACE {} #ifndef Q_UNLIKELY # define Q_UNLIKELY(x) (x) #endif +#ifndef Q_ASSUME +# define Q_ASSUME(expr) +#endif +#ifndef Q_UNREACHABLE +# define Q_UNREACHABLE() +#endif #ifndef Q_ALLOC_SIZE # define Q_ALLOC_SIZE(x) -- cgit v1.2.3