Commit cd6c5cfd authored by Max Kellermann's avatar Max Kellermann Committed by Max Kellermann

Compiler.h: exclude clang from GCC_CHECK_VERSION()

parent b855f2fc
...@@ -28,8 +28,13 @@ ...@@ -28,8 +28,13 @@
#define GCC_VERSION 0 #define GCC_VERSION 0
#endif #endif
/**
* Are we building with the specified version of gcc (not clang or any
* other compiler) or newer?
*/
#define GCC_CHECK_VERSION(major, minor) \ #define GCC_CHECK_VERSION(major, minor) \
(defined(__GNUC__) && GCC_VERSION >= GCC_MAKE_VERSION(major, minor, 0)) (defined(__GNUC__) && !defined(__clang__) && \
GCC_VERSION >= GCC_MAKE_VERSION(major, minor, 0))
/** /**
* Are we building with clang (any version) or at least the specified * Are we building with clang (any version) or at least the specified
...@@ -138,7 +143,7 @@ ...@@ -138,7 +143,7 @@
#endif /* ! GCC_UNUSED >= 40300 */ #endif /* ! GCC_UNUSED >= 40300 */
#if GCC_CHECK_VERSION(4,6) && !defined(__clang__) #if GCC_CHECK_VERSION(4,6)
#define gcc_flatten __attribute__((flatten)) #define gcc_flatten __attribute__((flatten))
#else #else
#define gcc_flatten #define gcc_flatten
......
...@@ -111,7 +111,7 @@ AllocatedPath::ChopSeparators() ...@@ -111,7 +111,7 @@ AllocatedPath::ChopSeparators()
while (l >= 2 && PathTraitsFS::IsSeparator(p[l - 1])) { while (l >= 2 && PathTraitsFS::IsSeparator(p[l - 1])) {
--l; --l;
#if GCC_CHECK_VERSION(4,7) && !defined(__clang__) #if GCC_CHECK_VERSION(4,7)
value.pop_back(); value.pop_back();
#else #else
value.erase(value.end() - 1, value.end()); value.erase(value.end() - 1, value.end());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment