__builtin_unreachable was added to GCC in version 4.5, so fix macros
authorThiago Macieira <thiago.macieira@intel.com>
Thu, 12 Apr 2012 18:40:00 +0000 (15:40 -0300)
committerQt by Nokia <qt-info@nokia.com>
Fri, 13 Apr 2012 06:33:40 +0000 (08:33 +0200)
Change-Id: Ida63bb46f696ae9d60331d863bf1478415a08ff2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
src/corelib/global/qcompilerdetection.h

index a043e5e..94befa9 100644 (file)
 #    define Q_UNREACHABLE() __builtin_unreachable()
 #  else
 /* Plain GCC */
-#    define Q_ASSUME(expr)  if (expr){} else __builtin_unreachable()
-#    define Q_UNREACHABLE() __builtin_unreachable()
+#    if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405
+#      define Q_ASSUME(expr)  if (expr){} else __builtin_unreachable()
+#      define Q_UNREACHABLE() __builtin_unreachable()
+#    endif
 #  endif
 
 #  define Q_ALIGNOF(type)   __alignof__(type)