From: Max Kellermann Date: Fri, 10 Mar 2017 20:38:59 +0000 (+0100) Subject: Compiler.h: reimplement GCC_CHECK_VERSION() using GCC_MAKE_VERSION() X-Git-Tag: v0.26~76 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3c7b327994a027cc0fe2584ee9655d98e63d1798;p=ncmpc.git Compiler.h: reimplement GCC_CHECK_VERSION() using GCC_MAKE_VERSION() --- diff --git a/src/Compiler.h b/src/Compiler.h index ef13a54..d76c8f6 100644 --- a/src/Compiler.h +++ b/src/Compiler.h @@ -20,10 +20,6 @@ #ifndef COMPILER_H #define COMPILER_H -#define GCC_CHECK_VERSION(major, minor) \ - (defined(__GNUC__) && \ - (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))) - #define GCC_MAKE_VERSION(major, minor, patchlevel) ((major) * 10000 + (minor) * 100 + patchlevel) #ifdef __GNUC__ @@ -38,6 +34,9 @@ # define CLANG_VERSION 0 #endif +#define GCC_CHECK_VERSION(major, minor) \ + (GCC_VERSION >= GCC_MAKE_VERSION(major, minor, 0)) + /** * Are we building with clang (any version) or at least the specified * gcc version?