mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
cpu.h: Fix compiler detection
GCC version 4.6 was throwing an error on `__has_attribute` which seems to be Clang specific. Solution was to un-nest the CPP code so that Clang is confirmed before the `__has_attribute` is hit.
This commit is contained in:
@@ -88,7 +88,7 @@
|
|||||||
#define FLAC__AVX2_SUPPORTED 1
|
#define FLAC__AVX2_SUPPORTED 1
|
||||||
#define FLAC__FMA_SUPPORTED 1
|
#define FLAC__FMA_SUPPORTED 1
|
||||||
#endif
|
#endif
|
||||||
#elif defined __GNUC__ || defined __clang__
|
#elif defined __GNUC__ && defined __clang__
|
||||||
#if defined __clang__ && __has_attribute(__target__) /* clang */
|
#if defined __clang__ && __has_attribute(__target__) /* clang */
|
||||||
#define FLAC__SSE_TARGET(x) __attribute__ ((__target__ (x)))
|
#define FLAC__SSE_TARGET(x) __attribute__ ((__target__ (x)))
|
||||||
#if __has_builtin(__builtin_ia32_maxps)
|
#if __has_builtin(__builtin_ia32_maxps)
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
#if __has_builtin(__builtin_ia32_pabsd256)
|
#if __has_builtin(__builtin_ia32_pabsd256)
|
||||||
#define FLAC__AVX2_SUPPORTED 1
|
#define FLAC__AVX2_SUPPORTED 1
|
||||||
#endif
|
#endif
|
||||||
#elif !defined __clang__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)) /* GCC 4.9+ */
|
#elif defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)) /* GCC 4.9+ */
|
||||||
#define FLAC__SSE_TARGET(x) __attribute__ ((__target__ (x)))
|
#define FLAC__SSE_TARGET(x) __attribute__ ((__target__ (x)))
|
||||||
#define FLAC__SSE_SUPPORTED 1
|
#define FLAC__SSE_SUPPORTED 1
|
||||||
#define FLAC__SSE2_SUPPORTED 1
|
#define FLAC__SSE2_SUPPORTED 1
|
||||||
|
|||||||
Reference in New Issue
Block a user