summaryrefslogtreecommitdiffstats
path: root/src/sanity.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-08-27 16:11:40 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-08-28 17:33:20 -0400
commite19f2a8a4b3103134f06e5f8e5b59b61488c885f (patch)
treec606a90cfbd24c4ebe69e7c8c49bea9a5c9b7c18 /src/sanity.h
parent386fc8817e637fdd52c20e4ace6cc4ea1f1186ed (diff)
downloadbfs-e19f2a8a4b3103134f06e5f8e5b59b61488c885f.tar.xz
prelude: Define __SANITIZE_*__
Diffstat (limited to 'src/sanity.h')
-rw-r--r--src/sanity.h18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/sanity.h b/src/sanity.h
index e168b8f..4488be5 100644
--- a/src/sanity.h
+++ b/src/sanity.h
@@ -11,18 +11,6 @@
#include "prelude.h"
#include <stddef.h>
-#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
-
// Call macro(ptr, size) or macro(ptr, sizeof(*ptr))
#define SANITIZE_CALL(...) \
SANITIZE_CALL_(__VA_ARGS__, )
@@ -33,7 +21,7 @@
#define SANITIZE_CALL__(macro, ptr, size, ...) \
macro(ptr, size)
-#if SANITIZE_ADDRESS
+#if __SANITIZE_ADDRESS__
# include <sanitizer/asan_interface.h>
/**
@@ -55,7 +43,7 @@
# define sanitize_free sanitize_uninit
#endif
-#if SANITIZE_MEMORY
+#if __SANITIZE_MEMORY__
# include <sanitizer/msan_interface.h>
/**
@@ -85,7 +73,7 @@
/**
* Initialize a variable, unless sanitizers would detect uninitialized uses.
*/
-#if SANITIZE_MEMORY
+#if __SANITIZE_MEMORY__
# define uninit(value)
#else
# define uninit(value) = value