diff --git a/webrtc/base/checks.cc b/webrtc/base/checks.cc index 99d8877b1c..5de1a8044c 100644 --- a/webrtc/base/checks.cc +++ b/webrtc/base/checks.cc @@ -111,6 +111,9 @@ void FatalMessage::Init(const char* file, int line) { << 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 @@ template std::string* MakeCheckOpString( 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 9f8122e168..b3917bb559 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_CHECK_OP_IMPL(GT, > ) #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