From a4554a7dfeafea635f65fcf33f03e46ce8563f57 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 14 Jul 2016 13:21:39 +0200 Subject: [PATCH] gcc build fix --- dtool/src/dtoolbase/dtoolbase.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dtool/src/dtoolbase/dtoolbase.h b/dtool/src/dtoolbase/dtoolbase.h index eff05d5022..712e7172e4 100644 --- a/dtool/src/dtoolbase/dtoolbase.h +++ b/dtool/src/dtoolbase/dtoolbase.h @@ -72,6 +72,10 @@ #endif #endif /* WIN32_VC */ +#ifndef __has_builtin +#define __has_builtin(x) 0 +#endif + // Use NODEFAULT to optimize a switch() stmt to tell MSVC to automatically go // to the final untested case after it has failed all the other cases (i.e. // 'assume at least one of the cases is always true') @@ -79,7 +83,7 @@ #define NODEFAULT default: assert(0); break; #elif defined(_MSC_VER) #define NODEFAULT default: __assume(0); // special VC keyword -#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) || (defined(__has_builtin) && __has_builtin(__builtin_unreachable)) +#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) || __has_builtin(__builtin_unreachable) #define NODEFAULT default: __builtin_unreachable(); #else #define NODEFAULT