diff options
author | Max Kellermann <max@duempel.org> | 2012-06-12 19:21:26 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-06-12 19:22:20 +0200 |
commit | 50cfb997ccbbebd6387f2f2cfbc3279d8426020f (patch) | |
tree | 5b6bf8ba41cac524c514b166b84a50ac0a8ed75a /src | |
parent | 6bb166aaaa387f20aca469b6463ba1ad96942d06 (diff) | |
download | mpd-50cfb997ccbbebd6387f2f2cfbc3279d8426020f.tar.gz mpd-50cfb997ccbbebd6387f2f2cfbc3279d8426020f.tar.xz mpd-50cfb997ccbbebd6387f2f2cfbc3279d8426020f.zip |
gcc.h: backport GCC_CHECK_VERSION() from v0.17.x
Diffstat (limited to '')
-rw-r--r-- | src/gcc.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -20,13 +20,18 @@ #ifndef MPD_GCC_H #define MPD_GCC_H +#define GCC_CHECK_VERSION(major, minor) \ + (defined(__GNUC__) && \ + (__GNUC__ > (major) || \ + (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))) + /* this allows us to take advantage of special gcc features while still * allowing other compilers to compile: * * example taken from: http://rlove.org/log/2005102601 */ -#if defined(__GNUC__) && (__GNUC__ >= 3) +#if GCC_CHECK_VERSION(3,0) # define mpd_must_check __attribute__ ((warn_unused_result)) # define mpd_packed __attribute__ ((packed)) /* these are very useful for type checking */ |