Define __ADDRESS_SANITIZER__ if compiling under clang's AddressSanitizer

This commit is contained in:
Ondřej Surý 2018-12-19 09:54:37 +01:00
parent 16d486ec59
commit e1ce3a3d42

View file

@ -206,6 +206,11 @@
#define __has_feature(x) 0
#endif
/* GCC defines __ADDRESS_SANITIZER__, so reuse the macro for clang */
#if __has_feature(address_sanitizer)
#define __ADDRESS_SANITIZER__
#endif
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR >= 6)
#define STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
#elif __has_feature(c_static_assert)