Browse Source

gcc build fix

rdb 9 years ago
parent
commit
a4554a7dfe
1 changed files with 5 additions and 1 deletions
  1. 5 1
      dtool/src/dtoolbase/dtoolbase.h

+ 5 - 1
dtool/src/dtoolbase/dtoolbase.h

@@ -72,6 +72,10 @@
 #endif
 #endif
 #endif  /* WIN32_VC */
 #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
 // 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.
 // 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')
 // 'assume at least one of the cases is always true')
@@ -79,7 +83,7 @@
 #define NODEFAULT  default: assert(0); break;
 #define NODEFAULT  default: assert(0); break;
 #elif defined(_MSC_VER)
 #elif defined(_MSC_VER)
 #define NODEFAULT  default: __assume(0);   // special VC keyword
 #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();
 #define NODEFAULT  default: __builtin_unreachable();
 #else
 #else
 #define NODEFAULT
 #define NODEFAULT