Support absl::string_view in RTC_CHECK.
Bug: None Change-Id: I8d4c296f1ac16a96adb88401f78ee9f65911bfc0 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126482 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27052}
This commit is contained in:

committed by
Commit Bot

parent
8cc711a7e1
commit
d4a37a6ee6
@ -42,6 +42,7 @@ RTC_NORETURN void rtc_FatalMessage(const char* file, int line, const char* msg);
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "rtc_base/numerics/safe_compare.h"
|
||||
#include "rtc_base/system/inline.h"
|
||||
|
||||
@ -99,6 +100,7 @@ enum class CheckArgType : int8_t {
|
||||
kLongDouble,
|
||||
kCharP,
|
||||
kStdString,
|
||||
kStringView,
|
||||
kVoidP,
|
||||
|
||||
// kCheckOp doesn't represent an argument type. Instead, it is sent as the
|
||||
@ -157,6 +159,10 @@ inline Val<CheckArgType::kStdString, const std::string*> MakeVal(
|
||||
const std::string& x) {
|
||||
return {&x};
|
||||
}
|
||||
inline Val<CheckArgType::kStringView, const absl::string_view*> MakeVal(
|
||||
const absl::string_view& x) {
|
||||
return {&x};
|
||||
}
|
||||
|
||||
inline Val<CheckArgType::kVoidP, const void*> MakeVal(const void* x) {
|
||||
return {x};
|
||||
|
Reference in New Issue
Block a user