diff options
Diffstat (limited to 'src/testzzuf/mhd_debug_funcs.c')
-rw-r--r-- | src/testzzuf/mhd_debug_funcs.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/testzzuf/mhd_debug_funcs.c b/src/testzzuf/mhd_debug_funcs.c index 9bfd3001..5db50b41 100644 --- a/src/testzzuf/mhd_debug_funcs.c +++ b/src/testzzuf/mhd_debug_funcs.c | |||
@@ -61,3 +61,48 @@ MHD_avoid_accept4_ (struct MHD_Daemon *daemon) | |||
61 | #endif /* ! _DEBUG */ | 61 | #endif /* ! _DEBUG */ |
62 | #endif /* USE_ACCEPT4 */ | 62 | #endif /* USE_ACCEPT4 */ |
63 | } | 63 | } |
64 | |||
65 | #ifdef MHD_ASAN_ACTIVE | ||
66 | #define MHD_ASAN_ENABLED_ 1 | ||
67 | #else /* ! MHD_ASAN_ACTIVE */ | ||
68 | #ifdef __SANITIZE_ADDRESS__ | ||
69 | #define MHD_ASAN_ENABLED_ 1 | ||
70 | #else /* ! __SANITIZE_ADDRESS__ */ | ||
71 | #if defined(__has_feature) | ||
72 | #if __has_feature(address_sanitizer) | ||
73 | #define MHD_ASAN_ENABLED_ 1 | ||
74 | #endif /* __has_feature(address_sanitizer) */ | ||
75 | #endif /* __has_feature */ | ||
76 | #endif /* ! __SANITIZE_ADDRESS__ */ | ||
77 | #endif /* ! MHD_ASAN_ACTIVE */ | ||
78 | /** | ||
79 | * Checks whether any know sanitizer is enabled for this build. | ||
80 | * zzuf does not work together with sanitizers as both are intercepting | ||
81 | * standard library calls. | ||
82 | * @return non-zero if any sanitizer is enabled, | ||
83 | * zero otherwise | ||
84 | */ | ||
85 | int | ||
86 | MHD_are_sanitizers_enabled_ (void) | ||
87 | { | ||
88 | int ret = 0; | ||
89 | #ifdef MHD_ASAN_ENABLED_ | ||
90 | ++ret; | ||
91 | #endif /* ! MHD_ASAN_ENABLED_ */ | ||
92 | #if defined(__has_feature) | ||
93 | #if __has_feature(thread_sanitizer) | ||
94 | ++ret; | ||
95 | #endif | ||
96 | #if __has_feature(memory_sanitizer) | ||
97 | ++ret; | ||
98 | #endif | ||
99 | #if __has_feature(dataflow_sanitizer) | ||
100 | ++ret; | ||
101 | #endif | ||
102 | #else /* ! defined(__has_feature) */ | ||
103 | #ifdef __SANITIZE_THREAD__ | ||
104 | ++ret; | ||
105 | #endif | ||
106 | #endif /* ! defined(__has_feature) */ | ||
107 | return ret; | ||
108 | } | ||