From: Yann Collet Date: Sat, 24 Mar 2018 01:45:42 +0000 (-0700) Subject: make DYNAMIC_BMI2 support of clang conditional to __has_attribute() X-Git-Tag: v1.3.4~1^2~5^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52ca7c6c565579bfc732184597a30fa904656493;p=thirdparty%2Fzstd.git make DYNAMIC_BMI2 support of clang conditional to __has_attribute() to support older clang versions such as 3.4 --- diff --git a/lib/common/compiler.h b/lib/common/compiler.h index bb8730126..a6044c861 100644 --- a/lib/common/compiler.h +++ b/lib/common/compiler.h @@ -74,7 +74,7 @@ * Enabled for clang & gcc >=4.8 on x86 when BMI2 isn't enabled by default. */ #ifndef DYNAMIC_BMI2 - #if defined(__clang__) \ + #if (defined(__clang__) && __has_attribute(__target__)) \ || (defined(__GNUC__) \ && (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))) \ && (defined(__x86_64__) || defined(_M_X86)) \