mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Extend config.h
to support HWSan and LSan
The constexpr functions can be used to ensure that all branches actually compile (unlike plain preprocessor `#ifdef`s). PiperOrigin-RevId: 432186834 Change-Id: I1a8d97dac8480fe9d4543b0e9e39540ca1efc8fa
This commit is contained in:
parent
077203fcf2
commit
725a5c11a8
|
@ -150,8 +150,26 @@ constexpr bool IsASan() {
|
|||
#endif
|
||||
}
|
||||
|
||||
constexpr bool IsHwASan() {
|
||||
#ifdef ABSL_HAVE_HWADDRESS_SANITIZER
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
constexpr bool IsLSan() {
|
||||
#ifdef ABSL_HAVE_LEAK_SANITIZER
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Returns whether any of the sanitizers is enabled.
|
||||
constexpr bool IsAny() { return IsMSan() || IsTSan() || IsASan(); }
|
||||
constexpr bool IsAny() {
|
||||
return IsMSan() || IsTSan() || IsASan() || IsHwASan() || IsLSan();
|
||||
}
|
||||
|
||||
} // namespace sanitizers
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user