diff options
author | Max Kellermann <max@duempel.org> | 2011-09-15 09:22:48 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2011-09-15 09:22:48 +0200 |
commit | d0c85a5a96022f9ef091b335c418eef5b290d6cc (patch) | |
tree | 61c6bb5bd24d02cfcf84565591f78b64b1d5133d /src/gcc.h | |
parent | 46ed717af4f9d0a43278d82ce77264d67becf6cb (diff) | |
download | mpd-d0c85a5a96022f9ef091b335c418eef5b290d6cc.tar.gz mpd-d0c85a5a96022f9ef091b335c418eef5b290d6cc.tar.xz mpd-d0c85a5a96022f9ef091b335c418eef5b290d6cc.zip |
gcc.h: add macro GCC_CHECK_VERSION
Diffstat (limited to 'src/gcc.h')
-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 gcc_must_check __attribute__ ((warn_unused_result)) # define gcc_packed __attribute__ ((packed)) /* these are very useful for type checking */ |