Avi Drissman | e4622aa | 2022-09-08 20:36:06 | [diff] [blame] | 1 | // Copyright 2020 The Chromium Authors |
Hans Wennborg | 944479f | 2020-06-25 21:39:25 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef BASE_DCHECK_IS_ON_H_ |
| 6 | #define BASE_DCHECK_IS_ON_H_ |
| 7 | |
Benoit Lize | 59551e5 | 2021-02-24 15:23:40 | [diff] [blame] | 8 | #include "base/debug/debugging_buildflags.h" |
| 9 | |
Hans Wennborg | 944479f | 2020-06-25 21:39:25 | [diff] [blame] | 10 | #if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON) |
| 11 | #define DCHECK_IS_ON() false |
| 12 | #else |
| 13 | #define DCHECK_IS_ON() true |
| 14 | #endif |
| 15 | |
Benoit Lize | 59551e5 | 2021-02-24 15:23:40 | [diff] [blame] | 16 | #if BUILDFLAG(EXPENSIVE_DCHECKS_ARE_ON) |
| 17 | #define EXPENSIVE_DCHECKS_ARE_ON() true |
| 18 | #else |
| 19 | #define EXPENSIVE_DCHECKS_ARE_ON() false |
| 20 | #endif |
| 21 | |
Hans Wennborg | 944479f | 2020-06-25 21:39:25 | [diff] [blame] | 22 | #endif // BASE_DCHECK_IS_ON_H_ |