From 81243c9d8fc36eb06c49f86fb3d560c0ebc18d72 Mon Sep 17 00:00:00 2001 From: Ryan Prichard Date: Fri, 5 Jan 2024 17:50:56 -0800 Subject: [windows] Fix std::stringstream error after upgrading libc++ Upgrading libc++ adds a deleted overload for operator<< when writing a wchar_t* to a std::stringstream, because it surprisingly prints an address rather than the string content. See the proposal in wg21.link/p1423r3. Converting to a UTF-8 string is tedious, and I don't know how to test this code, so make the surprising behavior explicit to fix the compiler error. Bug: 175635923 Test: m adb adbd Change-Id: I50ee7087d2e8fcd6a7dae9c8ffb99563be34051b --- platform/impl/network_interface_win.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/impl/network_interface_win.cc b/platform/impl/network_interface_win.cc index c3095457..165e1dc7 100644 --- a/platform/impl/network_interface_win.cc +++ b/platform/impl/network_interface_win.cc @@ -104,8 +104,10 @@ std::vector GetAllInterfaces() { } } OSP_DVLOG << "\tIfType=" << pcurraddrs->IfType; - OSP_DVLOG << "\tDescription=" << pcurraddrs->Description; - OSP_DVLOG << "\tFreindlyName=" << pcurraddrs->FriendlyName; + // TODO: Convert the wide strings to the proper narrow encoding (e.g. + // UTF-8) rather than print the addresses. + OSP_DVLOG << "\tDescription=" << static_cast(pcurraddrs->Description); + OSP_DVLOG << "\tFriendlyName=" << static_cast(pcurraddrs->FriendlyName); pcurraddrs = pcurraddrs->Next; } return infos; -- cgit v1.2.3