From 2f1a4370d5dfd9657eff98c0016820e1e0540925 Mon Sep 17 00:00:00 2001 From: Peter Kasting Date: Mon, 25 Jul 2022 15:24:33 -0700 Subject: [PATCH] Avoid sending wide strings to narrow streams. This overload was removed in C++20. Bug: chromium:1284275 Change-Id: I67a25ae23fa111e4972d1b207f1c078da13d86a3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269440 Reviewed-by: Mark Foltz Auto-Submit: Peter Kasting Commit-Queue: Peter Kasting Cr-Commit-Position: refs/heads/main@{#37630} --- modules/desktop_capture/win/desktop.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/desktop_capture/win/desktop.cc b/modules/desktop_capture/win/desktop.cc index 4fdf266a46..4a671dd9ae 100644 --- a/modules/desktop_capture/win/desktop.cc +++ b/modules/desktop_capture/win/desktop.cc @@ -13,6 +13,7 @@ #include #include "rtc_base/logging.h" +#include "rtc_base/string_utils.h" namespace webrtc { @@ -77,8 +78,8 @@ Desktop* Desktop::GetDesktop(const WCHAR* desktop_name) { DESKTOP_SWITCHDESKTOP | GENERIC_WRITE; HDESK desktop = OpenDesktopW(desktop_name, 0, FALSE, desired_access); if (desktop == NULL) { - RTC_LOG(LS_ERROR) << "Failed to open the desktop '" << desktop_name - << "': " << GetLastError(); + RTC_LOG(LS_ERROR) << "Failed to open the desktop '" + << rtc::ToUtf8(desktop_name) << "': " << GetLastError(); return NULL; }