|
@@ -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
|