diff options
author | Ryan Prichard <rprichard@google.com> | 2024-01-05 17:50:56 -0800 |
---|---|---|
committer | Ryan Prichard <rprichard@google.com> | 2024-01-05 17:52:42 -0800 |
commit | 81243c9d8fc36eb06c49f86fb3d560c0ebc18d72 (patch) | |
tree | 63e446e3fa43e252f48bff9e53c3787d995ded53 | |
parent | a1f37d7e15e391e1973053f8d58f07e4d240f1b4 (diff) | |
download | openscreen-81243c9d8fc36eb06c49f86fb3d560c0ebc18d72.tar.gz |
[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
-rw-r--r-- | platform/impl/network_interface_win.cc | 6 |
1 files 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<InterfaceInfo> 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<void*>(pcurraddrs->Description); + OSP_DVLOG << "\tFriendlyName=" << static_cast<void*>(pcurraddrs->FriendlyName); pcurraddrs = pcurraddrs->Next; } return infos; |