diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-08-27 16:11:40 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-08-28 17:33:20 -0400 |
commit | e19f2a8a4b3103134f06e5f8e5b59b61488c885f (patch) | |
tree | c606a90cfbd24c4ebe69e7c8c49bea9a5c9b7c18 /src/prelude.h | |
parent | 386fc8817e637fdd52c20e4ace6cc4ea1f1186ed (diff) | |
download | bfs-e19f2a8a4b3103134f06e5f8e5b59b61488c885f.tar.xz |
prelude: Define __SANITIZE_*__
Diffstat (limited to 'src/prelude.h')
-rw-r--r-- | src/prelude.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/prelude.h b/src/prelude.h index 59fa645..1f5c152 100644 --- a/src/prelude.h +++ b/src/prelude.h @@ -156,6 +156,18 @@ extern const char bfs_ldlibs[]; # define __has_builtin(builtin) false #endif +// Sanitizer macros (GCC defines these but Clang does not) + +#if __has_feature(address_sanitizer) && !defined(__SANITIZE_ADDRESS__) +# define __SANITIZE_ADDRESS__ true +#endif +#if __has_feature(memory_sanitizer) && !defined(__SANITIZE_MEMORY__) +# define __SANITIZE_MEMORY__ true +#endif +#if __has_feature(thread_sanitizer) && !defined(__SANITIZE_THREAD__) +# define __SANITIZE_THREAD__ true +#endif + // Fundamental utilities /** |