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-Commit-Position: refs/heads/master@{#9964}
diff --git a/webrtc/system_wrappers/interface/aligned_array.h b/webrtc/system_wrappers/interface/aligned_array.h
index 3648c7c..6d6c81b 100644
--- a/webrtc/system_wrappers/interface/aligned_array.h
+++ b/webrtc/system_wrappers/interface/aligned_array.h
@@ -24,7 +24,7 @@
: rows_(rows),
cols_(cols),
alignment_(alignment) {
- CHECK_GT(alignment_, 0);
+ RTC_CHECK_GT(alignment_, 0);
head_row_ = static_cast<T**>(AlignedMalloc(rows_ * sizeof(*head_row_),
alignment_));
for (int i = 0; i < rows_; ++i) {
@@ -49,22 +49,22 @@
}
T* Row(int row) {
- CHECK_LE(row, rows_);
+ RTC_CHECK_LE(row, rows_);
return head_row_[row];
}
const T* Row(int row) const {
- CHECK_LE(row, rows_);
+ RTC_CHECK_LE(row, rows_);
return head_row_[row];
}
T& At(int row, size_t col) {
- CHECK_LE(col, cols_);
+ RTC_CHECK_LE(col, cols_);
return Row(row)[col];
}
const T& At(int row, size_t col) const {
- CHECK_LE(col, cols_);
+ RTC_CHECK_LE(col, cols_);
return Row(row)[col];
}