Commit 86ba69fe authored by Christian Kellner's avatar Christian Kellner
Browse files

macros: detect address sanitizer (HAVE_ASAN)

Use the compiler specific method to detect if the code was compiled
with the address sanitizer enabled. This might be needed to skip
some incompatible tests.
parent c687041c
......@@ -54,4 +54,15 @@ G_BEGIN_DECLS
#define bolt_cleanup(x) __attribute__((cleanup (x)))
#if defined(__SANITIZE_ADDRESS__)
# define HAVE_ASAN 1
#elif defined(__has_feature)
# if __has_feature (address_sanitizer)
# define HAVE_ASAN 1
# endif
#endif
#ifndef HAVE_ASAN
# define HAVE_ASAN 0
#endif
G_END_DECLS
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment