Compiler.h: work around clang 3.9 warning -Wexpansion-to-defined
Check {GCC,CLANG}_VERSION==0 or >0 instead of using defined(), which may render undefined behavior.
This commit is contained in:
parent
093abaad29
commit
b05beb000f
1
NEWS
1
NEWS
|
@ -3,6 +3,7 @@ ver 0.19.19 (not yet released)
|
|||
- wildmidi: support libWildMidi 0.4
|
||||
* output
|
||||
- pulse: support 32 bit, 24 bit and floating point playback
|
||||
* fix clang 3.9 warnings
|
||||
|
||||
ver 0.19.18 (2016/08/05)
|
||||
* decoder
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
* other compiler) or newer?
|
||||
*/
|
||||
#define GCC_CHECK_VERSION(major, minor) \
|
||||
(!defined(__clang__) && \
|
||||
(CLANG_VERSION == 0 && \
|
||||
GCC_VERSION >= GCC_MAKE_VERSION(major, minor, 0))
|
||||
|
||||
/**
|
||||
|
@ -47,14 +47,14 @@
|
|||
* gcc version?
|
||||
*/
|
||||
#define CLANG_OR_GCC_VERSION(major, minor) \
|
||||
(defined(__clang__) || GCC_CHECK_VERSION(major, minor))
|
||||
(CLANG_VERSION > 0 || GCC_CHECK_VERSION(major, minor))
|
||||
|
||||
/**
|
||||
* Are we building with gcc (not clang or any other compiler) and a
|
||||
* version older than the specified one?
|
||||
*/
|
||||
#define GCC_OLDER_THAN(major, minor) \
|
||||
(defined(__GNUC__) && !defined(__clang__) && \
|
||||
(GCC_VERSION > 0 && CLANG_VERSION == 0 && \
|
||||
GCC_VERSION < GCC_MAKE_VERSION(major, minor, 0))
|
||||
|
||||
#ifdef __clang__
|
||||
|
|
Loading…
Reference in New Issue