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

Unified Diff: webrtc/base/criticalsection.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
Index: webrtc/base/criticalsection.h
diff --git a/webrtc/base/criticalsection.h b/webrtc/base/criticalsection.h
index bf77e2b78b64f99fc0f7ddf7299ad62d96baff0e..bfa67b3e50f60c4dbfaa74adfdba876adb08d6f3 100644
--- a/webrtc/base/criticalsection.h
+++ b/webrtc/base/criticalsection.h
@@ -12,6 +12,7 @@
#define WEBRTC_BASE_CRITICALSECTION_H_
#include "webrtc/base/atomicops.h"
+#include "webrtc/base/checks.h"
#include "webrtc/base/constructormagic.h"
#include "webrtc/base/thread_annotations.h"
#include "webrtc/base/platform_thread_types.h"
@@ -37,11 +38,7 @@
#include <dispatch/dispatch.h>
#endif
-#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON))
-#define CS_DEBUG_CHECKS 1
-#else
-#define CS_DEBUG_CHECKS 0
-#endif
+#define CS_DEBUG_CHECKS (!!RTC_DCHECK_IS_ON)
ossu 2016/09/30 09:08:49 Why!!? uhm I mean, why "!!"? :) Isn't RTC_DCHECK_I
kwiberg-webrtc 2016/09/30 09:14:21 Will do (see other comment).
kjellander_webrtc 2016/09/30 10:42:28 Ah, I was going to ask what (!!RTC_DCHECK_IS_ON) m
kwiberg-webrtc 2016/09/30 11:20:41 Yes, ! maps 0 to 1 and all other values to 0, so !
#if CS_DEBUG_CHECKS
#define CS_DEBUG_CODE(x) x

Powered by Google App Engine
This is Rietveld 408576698