Add RTC_ prefix to (D)CHECKs and related macros.
We must remove dependency on Chromium, i.e. we can't use Chromium's base/logging.h. That means we need to define these macros in WebRTC also when doing Chromium builds. And this causes redefinition.
Alternative solutions:
* Check if we already have defined e.g. CHECK, and don't define them in that case. This makes us depend on include order in Chromium, which is not acceptable.
* Don't allow using the macros in WebRTC headers. Error prone since if someone adds it there by mistake it may compile fine, but later break if a header in added or order is changed in Chromium. That will be confusing and hard to enforce.
* Ensure that headers that are included by an embedder don't include our macros. This would require some heavy refactoring to be maintainable and enforcable.
* Changes in Chromium for this is obviously not an option.
BUG=chromium:468375
NOTRY=true
Review URL: https://codereview.webrtc.org/1335923002
Cr-Original-Commit-Position: refs/heads/master@{#9964}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 91d6edef35e7275879c30ce16ecb8b6dc73c6e4a
diff --git a/voice_engine/voe_network_impl.cc b/voice_engine/voe_network_impl.cc
index 17e0664..2ff6b6a 100644
--- a/voice_engine/voe_network_impl.cc
+++ b/voice_engine/voe_network_impl.cc
@@ -37,7 +37,7 @@
int VoENetworkImpl::RegisterExternalTransport(int channel,
Transport& transport) {
- DCHECK(_shared->statistics().Initialized());
+ RTC_DCHECK(_shared->statistics().Initialized());
voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
voe::Channel* channelPtr = ch.channel();
if (!channelPtr) {
@@ -48,7 +48,7 @@
}
int VoENetworkImpl::DeRegisterExternalTransport(int channel) {
- CHECK(_shared->statistics().Initialized());
+ RTC_CHECK(_shared->statistics().Initialized());
voe::ChannelOwner ch = _shared->channel_manager().GetChannel(channel);
voe::Channel* channelPtr = ch.channel();
if (!channelPtr) {
@@ -68,8 +68,8 @@
const void* data,
size_t length,
const PacketTime& packet_time) {
- CHECK(_shared->statistics().Initialized());
- CHECK(data);
+ RTC_CHECK(_shared->statistics().Initialized());
+ RTC_CHECK(data);
// L16 at 32 kHz, stereo, 10 ms frames (+12 byte RTP header) -> 1292 bytes
if ((length < 12) || (length > 1292)) {
LOG_F(LS_ERROR) << "Invalid packet length: " << length;
@@ -92,8 +92,8 @@
int VoENetworkImpl::ReceivedRTCPPacket(int channel,
const void* data,
size_t length) {
- CHECK(_shared->statistics().Initialized());
- CHECK(data);
+ RTC_CHECK(_shared->statistics().Initialized());
+ RTC_CHECK(data);
if (length < 4) {
LOG_F(LS_ERROR) << "Invalid packet length: " << length;
return -1;