dcheck_is_on.h 559 B

12345678910111213141516171819202122
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef BASE_DCHECK_IS_ON_H_
  5. #define BASE_DCHECK_IS_ON_H_
  6. #include "base/debug/debugging_buildflags.h"
  7. #if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON)
  8. #define DCHECK_IS_ON() false
  9. #else
  10. #define DCHECK_IS_ON() true
  11. #endif
  12. #if BUILDFLAG(EXPENSIVE_DCHECKS_ARE_ON)
  13. #define EXPENSIVE_DCHECKS_ARE_ON() true
  14. #else
  15. #define EXPENSIVE_DCHECKS_ARE_ON() false
  16. #endif
  17. #endif // BASE_DCHECK_IS_ON_H_