| // Copyright 2020 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #ifndef THIRD_PARTY_BASE_CHECK_H_ |
| #define THIRD_PARTY_BASE_CHECK_H_ |
| #include "build/build_config.h" |
| #include "third_party/base/compiler_specific.h" |
| #include "third_party/base/immediate_crash.h" |
| #define CHECK(condition) \ |
| if (UNLIKELY(!(condition))) { \ |
| #if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON) |
| // Debug mode: Use assert() for better diagnostics |
| // Release mode, DCHECK_ALWAYS_ON: Use CHECK() since assert() is a no-op. |
| // Release mode, no DCHECK_ALWAYS_ON: Use assert(), which is a no-op. |
| #if defined(NDEBUG) && defined(DCHECK_ALWAYS_ON) |
| #endif // THIRD_PARTY_BASE_CHECK_H_ |