mirror of
https://github.com/LizardByte/Sunshine.git
synced 2026-02-04 20:15:41 +00:00
fix(hostname): fix handling of non-ASCII hostnames on Windows (#3382)
This commit is contained in:
@ -1846,6 +1846,16 @@ namespace platf {
|
||||
return output;
|
||||
}
|
||||
|
||||
std::string
|
||||
get_host_name() {
|
||||
WCHAR hostname[256];
|
||||
if (GetHostNameW(hostname, ARRAYSIZE(hostname)) == SOCKET_ERROR) {
|
||||
BOOST_LOG(error) << "GetHostNameW() failed: "sv << WSAGetLastError();
|
||||
return "Sunshine"s;
|
||||
}
|
||||
return to_utf8(hostname);
|
||||
}
|
||||
|
||||
class win32_high_precision_timer: public high_precision_timer {
|
||||
public:
|
||||
win32_high_precision_timer() {
|
||||
|
||||
Reference in New Issue
Block a user