Compiler.h: always define CLANG_VERSION
This commit is contained in:
parent
e84e4169f9
commit
093abaad29
@ -28,6 +28,12 @@
|
|||||||
#define GCC_VERSION 0
|
#define GCC_VERSION 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
# define CLANG_VERSION GCC_MAKE_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__)
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
# define CLANG_VERSION 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Are we building with the specified version of gcc (not clang or any
|
* Are we building with the specified version of gcc (not clang or any
|
||||||
* other compiler) or newer?
|
* other compiler) or newer?
|
||||||
@ -52,7 +58,6 @@
|
|||||||
GCC_VERSION < GCC_MAKE_VERSION(major, minor, 0))
|
GCC_VERSION < GCC_MAKE_VERSION(major, minor, 0))
|
||||||
|
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
# define CLANG_VERSION GCC_MAKE_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__)
|
|
||||||
# if __clang_major__ < 3
|
# if __clang_major__ < 3
|
||||||
# error Sorry, your clang version is too old. You need at least version 3.1.
|
# error Sorry, your clang version is too old. You need at least version 3.1.
|
||||||
# endif
|
# endif
|
||||||
@ -68,8 +73,7 @@
|
|||||||
* Are we building with the specified version of clang or newer?
|
* Are we building with the specified version of clang or newer?
|
||||||
*/
|
*/
|
||||||
#define CLANG_CHECK_VERSION(major, minor) \
|
#define CLANG_CHECK_VERSION(major, minor) \
|
||||||
(defined(__clang__) && \
|
(CLANG_VERSION >= GCC_MAKE_VERSION(major, minor, 0))
|
||||||
CLANG_VERSION >= GCC_MAKE_VERSION(major, minor, 0))
|
|
||||||
|
|
||||||
#if CLANG_OR_GCC_VERSION(4,0)
|
#if CLANG_OR_GCC_VERSION(4,0)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user