summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-04-12 15:40:00 -0300
committerQt by Nokia <qt-info@nokia.com>2012-04-13 08:33:40 +0200
commite07cadecc22b668b13e52ac85a4fddb4631aebb5 (patch)
treeb052af7a6b96ca6c3249eee3018c9afa9c1be091 /src
parent2a5ade68fd4b536c766de395d2657cd37c9bb98b (diff)
__builtin_unreachable was added to GCC in version 4.5, so fix macros
Change-Id: Ida63bb46f696ae9d60331d863bf1478415a08ff2 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qcompilerdetection.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index a043e5e072..94befa9ab8 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -153,8 +153,10 @@
# 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)