Stroika Library 3.0d25
 
Loading...
Searching...
No Matches
Sanitizer.inl
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2026. All rights reserved
3 */
4
5#if defined(__cplusplus)
6namespace Stroika::Foundation::Debug {
7}
8#endif
9
10/*
11 ********************************************************************************
12 ***************************** DEPRECATED (v3.0d25) *****************************
13 ********************************************************************************
14 */
15
16/*
17 * Stroika_Foundation_Debug_Sanitizer_HAS_AddressSanitizer, ..._HAS_ThreadSanitizer, ..._HAS_UndefinedBehaviorSanitizer
18 * *** DEPRECATED IN STROIKA 3.0d25 *** (to be removed at the end of the 3.0d development period)
19 *
20 * Use Debug::kBuiltWithAddressSanitizer, kBuiltWithThreadSanitizer or kBuiltWithUndefinedBehaviorSanitizer instead; where an
21 * #if needs the answer, copy the compile-time test documented on each (@see Sanitizer.h).
22 *
23 * \note Stroika no longer uses these, so defining them (e.g. with -D) no longer affects anything else.
24 * \note Stroika_Foundation_Debug_Sanitizer_HAS_UndefinedBehaviorSanitizer is 0 on g++ before 14 even in an undefined behavior
25 * sanitizer build - there is no compile-time way to tell there (Debug::kBuiltWithUndefinedBehaviorSanitizer is right).
26 */
27#if !defined(Stroika_Foundation_Debug_Sanitizer_HAS_AddressSanitizer)
28#if defined(__SANITIZE_ADDRESS__)
29#define Stroika_Foundation_Debug_Sanitizer_HAS_AddressSanitizer 1
30#elif defined(__has_feature)
31#define Stroika_Foundation_Debug_Sanitizer_HAS_AddressSanitizer __has_feature (address_sanitizer)
32#else
33#define Stroika_Foundation_Debug_Sanitizer_HAS_AddressSanitizer 0
34#endif
35#endif
36#if !defined(Stroika_Foundation_Debug_Sanitizer_HAS_ThreadSanitizer)
37#if defined(__SANITIZE_THREAD__)
38#define Stroika_Foundation_Debug_Sanitizer_HAS_ThreadSanitizer 1
39#elif defined(__has_feature)
40#define Stroika_Foundation_Debug_Sanitizer_HAS_ThreadSanitizer __has_feature (thread_sanitizer)
41#else
42#define Stroika_Foundation_Debug_Sanitizer_HAS_ThreadSanitizer 0
43#endif
44#endif
45#if !defined(Stroika_Foundation_Debug_Sanitizer_HAS_UndefinedBehaviorSanitizer)
46#if defined(__has_feature)
47#define Stroika_Foundation_Debug_Sanitizer_HAS_UndefinedBehaviorSanitizer __has_feature (undefined_behavior_sanitizer)
48#else
49#define Stroika_Foundation_Debug_Sanitizer_HAS_UndefinedBehaviorSanitizer 0
50#endif
51#endif