aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-11-28 18:55:09 +0100
committerMax Kellermann <max@duempel.org>2014-11-28 19:00:26 +0100
commit7745067d994c9b4adb720e10df8170c585eb4c98 (patch)
treed9115b8d70e48697d2dd1b0a0c46a2d47cd1f3a5
parentb19d3629b98f1ea2318a21d1bd26306d7e325bd0 (diff)
downloadmpd-7745067d994c9b4adb720e10df8170c585eb4c98.tar.gz
mpd-7745067d994c9b4adb720e10df8170c585eb4c98.tar.xz
mpd-7745067d994c9b4adb720e10df8170c585eb4c98.zip
Compiler.h: add macro GCC_MAKE_VERSION()
Diffstat (limited to '')
-rw-r--r--src/Compiler.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Compiler.h b/src/Compiler.h
index 44a87c7ba..f0569dd18 100644
--- a/src/Compiler.h
+++ b/src/Compiler.h
@@ -20,22 +20,20 @@
#ifndef COMPILER_H
#define COMPILER_H
+#define GCC_MAKE_VERSION(major, minor, patchlevel) ((major) * 10000 + (minor) * 100 + patchlevel)
+
#define GCC_CHECK_VERSION(major, minor) \
(defined(__GNUC__) && \
(__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))))
#ifdef __GNUC__
-#define GCC_VERSION (__GNUC__ * 10000 \
- + __GNUC_MINOR__ * 100 \
- + __GNUC_PATCHLEVEL__)
+#define GCC_VERSION GCC_MAKE_VERSION(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
#else
#define GCC_VERSION 0
#endif
#ifdef __clang__
-# define CLANG_VERSION (__clang_major__ * 10000 \
- + __clang_minor__ * 100 \
- + __clang_patchlevel__)
+# define CLANG_VERSION GCC_MAKE_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__)
# if __clang_major__ < 3
# error Sorry, your clang version is too old. You need at least version 3.1.
# endif