1
0
mirror of https://github.com/google/benchmark.git synced 2025-04-29 22:40:33 +08:00

Fix error: 'WC_ERR_INVALID_CHARS' was not declared in this scope

This commit is contained in:
zm1060 2023-10-16 09:48:35 +08:00
parent 682153afda
commit 335e4a3165

View File

@ -429,10 +429,10 @@ std::string GetSystemName() {
str = std::string(hostname, DWCOUNT);
#else
// `WideCharToMultiByte` returns `0` when conversion fails.
int len = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, hostname,
int len = WideCharToMultiByte(CP_UTF8, MB_ERR_INVALID_CHARS, hostname,
DWCOUNT, NULL, 0, NULL, NULL);
str.resize(len);
WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, hostname, DWCOUNT, &str[0],
WideCharToMultiByte(CP_UTF8, MB_ERR_INVALID_CHARS, hostname, DWCOUNT, &str[0],
str.size(), NULL, NULL);
#endif
return str;