util: Add unreachable() definition for clang compiler.
authorKrzysztof Raszkowski <krzysztof.raszkowski@intel.com>
Fri, 30 Aug 2019 05:50:21 +0000 (05:50 +0000)
committerJan Zielinski <jan.zielinski@intel.com>
Fri, 30 Aug 2019 05:50:21 +0000 (05:50 +0000)
Without unreachable() definition clang throw return-type error
in many places in mesa code.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
src/util/macros.h

index f5f099b..55dd80c 100644 (file)
@@ -72,7 +72,7 @@
  * Unreachable macro. Useful for suppressing "control reaches end of non-void
  * function" warnings.
  */
-#ifdef HAVE___BUILTIN_UNREACHABLE
+#if defined(HAVE___BUILTIN_UNREACHABLE) || __has_builtin(__builtin_unreachable)
 #define unreachable(str)    \
 do {                        \
    assert(!str);            \