summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2017-02-15 18:22:23 +1100
committerErik de Castro Lopo <erikd@mega-nerd.com>2017-02-15 20:16:01 +1100
commitc4bdd6fd7d3b6a0dea70f0ac31d73b6a25ecea7d (patch)
treeaaf360ef7cb03e747484798358e77cf9454f132c
parent3a7884bf532b134804a83632527d2de9a6b25a30 (diff)
downloadflac-c4bdd6fd7d3b6a0dea70f0ac31d73b6a25ecea7d.tar.gz
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.
-rw-r--r--src/libFLAC/include/private/cpu.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libFLAC/include/private/cpu.h b/src/libFLAC/include/private/cpu.h
index 623efc55..c2372d94 100644
--- a/src/libFLAC/include/private/cpu.h
+++ b/src/libFLAC/include/private/cpu.h
@@ -88,7 +88,7 @@
#define FLAC__AVX2_SUPPORTED 1
#define FLAC__FMA_SUPPORTED 1
#endif
-#elif defined __GNUC__ || defined __clang__
+#elif defined __GNUC__ && defined __clang__
#if defined __clang__ && __has_attribute(__target__) /* clang */
#define FLAC__SSE_TARGET(x) __attribute__ ((__target__ (x)))
#if __has_builtin(__builtin_ia32_maxps)
@@ -106,7 +106,7 @@
#if __has_builtin(__builtin_ia32_pabsd256)
#define FLAC__AVX2_SUPPORTED 1
#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_SUPPORTED 1
#define FLAC__SSE2_SUPPORTED 1