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 f5f099bb594443f25233b195e04bd148eefeeab6..55dd80c870b3c6b1c9c0262bf9b23cc93118a260 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);            \