make DYNAMIC_BMI2 support of clang conditional to __has_attribute()

to support older clang versions such as 3.4
This commit is contained in:
Yann Collet 2018-03-23 18:45:42 -07:00
parent 6a8d69c427
commit 52ca7c6c56

View File

@ -74,7 +74,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)) \