Fixed WINRT build - we need convert_utf8_to_utf16 in WINRT mode too

This commit is contained in:
Eugene Golushkov 2023-10-18 16:50:44 +02:00 committed by Howard Hinnant
parent 3e43210885
commit bbe2f51bc0

View File

@ -204,20 +204,6 @@ static CONSTDATA char folder_delimiter = '/';
#if !USE_OS_TZDB
# ifdef _WIN32
# ifndef WINRT
namespace
{
struct task_mem_deleter
{
void operator()(wchar_t buf[])
{
if (buf != nullptr)
CoTaskMemFree(buf);
}
};
using co_task_mem_ptr = std::unique_ptr<wchar_t[], task_mem_deleter>;
}
static
std::wstring
@ -248,6 +234,21 @@ convert_utf8_to_utf16(const std::string& s)
return out;
}
# ifndef WINRT
namespace
{
struct task_mem_deleter
{
void operator()(wchar_t buf[])
{
if (buf != nullptr)
CoTaskMemFree(buf);
}
};
using co_task_mem_ptr = std::unique_ptr<wchar_t[], task_mem_deleter>;
}
// We might need to know certain locations even if not using the remote API,
// so keep these routines out of that block for now.
static