Test RTC_DCHECK_IS_ON instead of checking DCHECK_ALWAYS_ON everywhere
The former is always defined (by webrtc/base/checks.h) to either 0 or 1, whereas the latter isn't necessarily defined. This is a re-land of https://codereview.webrtc.org/2384693002, which broke Chromium. We re-land without changing this CL at all, because the thing that needed fixing was in Chromium: https://codereview.chromium.org/2384263004. NOTRY=true TBR=ossu@webrtc.org BUG=webrtc:6451 Review-Url: https://codereview.webrtc.org/2389943003 Cr-Commit-Position: refs/heads/master@{#14508}
This commit is contained in:
@ -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
|
||||
|
||||
#if CS_DEBUG_CHECKS
|
||||
#define CS_DEBUG_CODE(x) x
|
||||
|
||||
Reference in New Issue
Block a user