From a62b1b98ceb99456f25c1839a11d9d1f749d84c6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 10 Mar 2017 21:39:42 +0100 Subject: [PATCH] Compiler.h: exclude clang from GCC_CHECK_VERSION() --- src/Compiler.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Compiler.h b/src/Compiler.h index d76c8f6..38c008f 100644 --- a/src/Compiler.h +++ b/src/Compiler.h @@ -34,8 +34,13 @@ # define CLANG_VERSION 0 #endif +/** + * Are we building with the specified version of gcc (not clang or any + * other compiler) or newer? + */ #define GCC_CHECK_VERSION(major, minor) \ - (GCC_VERSION >= GCC_MAKE_VERSION(major, minor, 0)) + (!CLANG_VERSION && \ + GCC_VERSION >= GCC_MAKE_VERSION(major, minor, 0)) /** * Are we building with clang (any version) or at least the specified @@ -124,7 +129,7 @@ #endif /* ! GCC_UNUSED >= 40300 */ -#if GCC_CHECK_VERSION(4,6) && !defined(__clang__) +#if GCC_CHECK_VERSION(4,6) #define gcc_flatten __attribute__((flatten)) #else #define gcc_flatten -- 2.30.2