mirror of https://git.tukaani.org/xz.git
tuklib_common: Define __has_warning if it is not defined.
clang supports the __has_warning macro to determine if the version of clang compiling the code supports a given warning. If we do not define it for other compilers, it may cause a preprocessor error.
This commit is contained in:
parent
b2ba1a489d
commit
82e3c968bf
|
@ -68,4 +68,11 @@
|
|||
# define TUKLIB_DOSLIKE 1
|
||||
#endif
|
||||
|
||||
// Clang has a macro to check if the compiler supports a certain warning.
|
||||
// If this macro is used with a compiler that does not support this macro
|
||||
// (like gcc), then it will cause a preprocessor error.
|
||||
#ifndef __has_warning
|
||||
# define __has_warning(warn) 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue