OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2006 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 // Helper functions for RTC_CHECK_OP macro. | 157 // Helper functions for RTC_CHECK_OP macro. |
158 // The (int, int) specialization works around the issue that the compiler | 158 // The (int, int) specialization works around the issue that the compiler |
159 // will not instantiate the template version of the function on values of | 159 // will not instantiate the template version of the function on values of |
160 // unnamed enum type - see comment below. | 160 // unnamed enum type - see comment below. |
161 #define DEFINE_RTC_CHECK_OP_IMPL(name) \ | 161 #define DEFINE_RTC_CHECK_OP_IMPL(name) \ |
162 template <class t1, class t2> \ | 162 template <class t1, class t2> \ |
163 inline std::string* Check##name##Impl(const t1& v1, const t2& v2, \ | 163 inline std::string* Check##name##Impl(const t1& v1, const t2& v2, \ |
164 const char* names) { \ | 164 const char* names) { \ |
165 if (rtc::safe_cmp::name(v1, v2)) \ | 165 if (rtc::safe_cmp::name(v1, v2)) \ |
166 return NULL; \ | 166 return nullptr; \ |
167 else \ | 167 else \ |
168 return rtc::MakeCheckOpString(v1, v2, names); \ | 168 return rtc::MakeCheckOpString(v1, v2, names); \ |
169 } \ | 169 } \ |
170 inline std::string* Check##name##Impl(int v1, int v2, const char* names) { \ | 170 inline std::string* Check##name##Impl(int v1, int v2, const char* names) { \ |
171 if (rtc::safe_cmp::name(v1, v2)) \ | 171 if (rtc::safe_cmp::name(v1, v2)) \ |
172 return NULL; \ | 172 return nullptr; \ |
173 else \ | 173 else \ |
174 return rtc::MakeCheckOpString(v1, v2, names); \ | 174 return rtc::MakeCheckOpString(v1, v2, names); \ |
175 } | 175 } |
176 DEFINE_RTC_CHECK_OP_IMPL(Eq) | 176 DEFINE_RTC_CHECK_OP_IMPL(Eq) |
177 DEFINE_RTC_CHECK_OP_IMPL(Ne) | 177 DEFINE_RTC_CHECK_OP_IMPL(Ne) |
178 DEFINE_RTC_CHECK_OP_IMPL(Le) | 178 DEFINE_RTC_CHECK_OP_IMPL(Le) |
179 DEFINE_RTC_CHECK_OP_IMPL(Lt) | 179 DEFINE_RTC_CHECK_OP_IMPL(Lt) |
180 DEFINE_RTC_CHECK_OP_IMPL(Ge) | 180 DEFINE_RTC_CHECK_OP_IMPL(Ge) |
181 DEFINE_RTC_CHECK_OP_IMPL(Gt) | 181 DEFINE_RTC_CHECK_OP_IMPL(Gt) |
182 #undef DEFINE_RTC_CHECK_OP_IMPL | 182 #undef DEFINE_RTC_CHECK_OP_IMPL |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 #define RTC_DCHECK_EQ(a, b) RTC_DCHECK((a) == (b)) | 280 #define RTC_DCHECK_EQ(a, b) RTC_DCHECK((a) == (b)) |
281 #define RTC_DCHECK_NE(a, b) RTC_DCHECK((a) != (b)) | 281 #define RTC_DCHECK_NE(a, b) RTC_DCHECK((a) != (b)) |
282 #define RTC_DCHECK_LE(a, b) RTC_DCHECK((a) <= (b)) | 282 #define RTC_DCHECK_LE(a, b) RTC_DCHECK((a) <= (b)) |
283 #define RTC_DCHECK_LT(a, b) RTC_DCHECK((a) < (b)) | 283 #define RTC_DCHECK_LT(a, b) RTC_DCHECK((a) < (b)) |
284 #define RTC_DCHECK_GE(a, b) RTC_DCHECK((a) >= (b)) | 284 #define RTC_DCHECK_GE(a, b) RTC_DCHECK((a) >= (b)) |
285 #define RTC_DCHECK_GT(a, b) RTC_DCHECK((a) > (b)) | 285 #define RTC_DCHECK_GT(a, b) RTC_DCHECK((a) > (b)) |
286 | 286 |
287 #endif // __cplusplus | 287 #endif // __cplusplus |
288 | 288 |
289 #endif // WEBRTC_BASE_CHECKS_H_ | 289 #endif // WEBRTC_BASE_CHECKS_H_ |
OLD | NEW |