Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Unified Diff: webrtc/base/checks.h

Issue 2384693002: Test RTC_DCHECK_IS_ON instead of checking DCHECK_ALWAYS_ON everywhere (Closed)
Patch Set: !!! Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/buffer.h ('k') | webrtc/base/criticalsection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/checks.h
diff --git a/webrtc/base/checks.h b/webrtc/base/checks.h
index a48971fd29dadc953a438e134e5c2dda67c20d65..2d0e8af5d2176000c7dcbc89e675567885cefa16 100644
--- a/webrtc/base/checks.h
+++ b/webrtc/base/checks.h
@@ -13,7 +13,10 @@
#include "webrtc/typedefs.h"
-#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON))
+// If you for some reson need to know if DCHECKs are on, test the value of
+// RTC_DCHECK_IS_ON. (Test its value, not if it's defined; it'll always be
+// defined, to either a true or a false value.)
+#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
#define RTC_DCHECK_IS_ON 1
#else
#define RTC_DCHECK_IS_ON 0
@@ -90,9 +93,9 @@ namespace rtc {
? static_cast<void>(0) \
: rtc::FatalMessageVoidify() & rtc::FatalMessage("", 0).stream()
-// RTC_CHECK dies with a fatal error if condition is not true. It is *not*
-// controlled by NDEBUG, so the check will be executed regardless of
-// compilation mode.
+// RTC_CHECK dies with a fatal error if condition is not true. It is *not*
+// controlled by NDEBUG or anything else, so the check will be executed
+// regardless of compilation mode.
//
// We make sure RTC_CHECK et al. always evaluates their arguments, as
// doing RTC_CHECK(FunctionWithSideEffect()) is a common idiom.
« no previous file with comments | « webrtc/base/buffer.h ('k') | webrtc/base/criticalsection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698