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

Unified Diff: ppapi/cpp/logging.h

Issue 2954883002: Add dvlog_always_on to enable DVLOG without DEBUG and DCHECK option
Patch Set: Created 3 years, 6 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 | « net/spdy/core/hpack/hpack_huffman_decoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/logging.h
diff --git a/ppapi/cpp/logging.h b/ppapi/cpp/logging.h
index d0a4f5b29a5635973571a9638900251379c56a41..098cb652a77a6b33d0043aed6463ed1f24dc990f 100644
--- a/ppapi/cpp/logging.h
+++ b/ppapi/cpp/logging.h
@@ -13,7 +13,11 @@
/// This macro asserts that 'a' evaluates to true. In debug mode, this macro
/// will crash the program if the assertion evaluates to false. It (typically)
/// has no effect in release mode.
+#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
#define PP_DCHECK(a) assert(a)
+#else // !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
+#define PP_DCHECK(a)
+#endif // !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
/// This macro asserts false in debug builds. It's used in code paths that you
/// don't expect to execute.
@@ -29,6 +33,10 @@
/// // Do stuff to the pointer, since you know it's valid.
/// pointer->DoSomething();
/// @endcode
+#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
#define PP_NOTREACHED() assert(false)
+#else // !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
+#define PP_NOTREACHED()
+#endif // !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
#endif // PPAPI_CPP_LOGGING_H_
« no previous file with comments | « net/spdy/core/hpack/hpack_huffman_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698