Precompile out our standalone CHECK macros in a Chromium build.
As documented, the use of overrides/webrtc/base/logging.h in a Chromium
build reuslts in redefined macro errors. Fortunately, Chromium's macros
can be used as drop-in replacements for the standalone versions.
TBR=henrike
Review URL: https://webrtc-codereview.appspot.com/17239004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7004 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/base/checks.cc b/webrtc/base/checks.cc
index 99d8877..5de1a80 100644
--- a/webrtc/base/checks.cc
+++ b/webrtc/base/checks.cc
@@ -111,6 +111,9 @@
<< file << ", line " << line << std::endl << "# ";
}
+// Refer to comments in checks.h.
+#ifndef WEBRTC_CHROMIUM_BUILD
+
// MSVC doesn't like complex extern templates and DLLs.
#if !defined(COMPILER_MSVC)
// Explicit instantiations for commonly used comparisons.
@@ -126,4 +129,6 @@
const std::string&, const std::string&, const char* name);
#endif
+#endif // WEBRTC_CHROMIUM_BUILD
+
} // namespace rtc
diff --git a/webrtc/base/checks.h b/webrtc/base/checks.h
index 9f8122e..b3917bb 100644
--- a/webrtc/base/checks.h
+++ b/webrtc/base/checks.h
@@ -52,6 +52,11 @@
namespace rtc {
+// The use of overrides/webrtc/base/logging.h in a Chromium build results in
+// redefined macro errors. Fortunately, Chromium's macros can be used as drop-in
+// replacements for the standalone versions.
+#ifndef WEBRTC_CHROMIUM_BUILD
+
// Helper macro which avoids evaluating the arguments to a stream if
// the condition doesn't hold.
#define LAZY_STREAM(stream, condition) \
@@ -162,6 +167,8 @@
#define DCHECK_LE(v1, v2) EAT_STREAM_PARAMETERS
#endif
+#endif // WEBRTC_CHROMIUM_BUILD
+
#define FATAL() rtc::FatalMessage(__FILE__, __LINE__).stream()
// TODO(ajm): Consider adding NOTIMPLEMENTED and NOTREACHED macros when
// base/logging.h and system_wrappers/logging.h are consolidated such that we