Check GCC for __has_attribute
The __has_attribute macro was one of improvements in GCC 5 release.
See https://gcc.gnu.org/gcc-5/changes.html.
This checks to make it work with older GCC.
BUG=angleproject:2119
Change-Id: I751249b9d028d1322829bebc1ca8d423edf27057
Reviewed-on: https://chromium-review.googlesource.com/599152
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/common/angleutils.h b/src/common/angleutils.h
index 05c56a3..7fd346d 100644
--- a/src/common/angleutils.h
+++ b/src/common/angleutils.h
@@ -255,7 +255,7 @@
}
// The below inlining code lifted from V8.
-#if defined(__clang__) || defined(__GNUC__)
+#if defined(__clang__) || (defined(__GNUC__) && defined(__has_attribute))
#define ANGLE_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline))
#define ANGLE_HAS___FORCEINLINE 0
#elif defined(_MSC_VER)