Merge pull request #1073 from facebook/hasAttribute
make `DYNAMIC_BMI2` support of `clang` conditional to `__has_attribute()`
This commit is contained in:
@@ -64,6 +64,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* target attribute */
|
/* target attribute */
|
||||||
|
#ifndef __has_attribute
|
||||||
|
#define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
|
||||||
|
#endif
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
# define TARGET_ATTRIBUTE(target) __attribute__((__target__(target)))
|
# define TARGET_ATTRIBUTE(target) __attribute__((__target__(target)))
|
||||||
#else
|
#else
|
||||||
@@ -74,7 +77,7 @@
|
|||||||
* Enabled for clang & gcc >=4.8 on x86 when BMI2 isn't enabled by default.
|
* Enabled for clang & gcc >=4.8 on x86 when BMI2 isn't enabled by default.
|
||||||
*/
|
*/
|
||||||
#ifndef DYNAMIC_BMI2
|
#ifndef DYNAMIC_BMI2
|
||||||
#if defined(__clang__) \
|
#if (defined(__clang__) && __has_attribute(__target__)) \
|
||||||
|| (defined(__GNUC__) \
|
|| (defined(__GNUC__) \
|
||||||
&& (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))) \
|
&& (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))) \
|
||||||
&& (defined(__x86_64__) || defined(_M_X86)) \
|
&& (defined(__x86_64__) || defined(_M_X86)) \
|
||||||
|
|||||||
Reference in New Issue
Block a user