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
|
- wildmidi: support libWildMidi 0.4
|
||||||
* output
|
* output
|
||||||
- pulse: support 32 bit, 24 bit and floating point playback
|
- pulse: support 32 bit, 24 bit and floating point playback
|
||||||
|
* fix clang 3.9 warnings
|
||||||
|
|
||||||
ver 0.19.18 (2016/08/05)
|
ver 0.19.18 (2016/08/05)
|
||||||
* decoder
|
* decoder
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
* other compiler) or newer?
|
* other compiler) or newer?
|
||||||
*/
|
*/
|
||||||
#define GCC_CHECK_VERSION(major, minor) \
|
#define GCC_CHECK_VERSION(major, minor) \
|
||||||
(!defined(__clang__) && \
|
(CLANG_VERSION == 0 && \
|
||||||
GCC_VERSION >= GCC_MAKE_VERSION(major, minor, 0))
|
GCC_VERSION >= GCC_MAKE_VERSION(major, minor, 0))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -47,14 +47,14 @@
|
||||||
* gcc version?
|
* gcc version?
|
||||||
*/
|
*/
|
||||||
#define CLANG_OR_GCC_VERSION(major, minor) \
|
#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
|
* Are we building with gcc (not clang or any other compiler) and a
|
||||||
* version older than the specified one?
|
* version older than the specified one?
|
||||||
*/
|
*/
|
||||||
#define GCC_OLDER_THAN(major, minor) \
|
#define GCC_OLDER_THAN(major, minor) \
|
||||||
(defined(__GNUC__) && !defined(__clang__) && \
|
(GCC_VERSION > 0 && CLANG_VERSION == 0 && \
|
||||||
GCC_VERSION < GCC_MAKE_VERSION(major, minor, 0))
|
GCC_VERSION < GCC_MAKE_VERSION(major, minor, 0))
|
||||||
|
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
|
|
Loading…
Reference in New Issue