mirror of
https://github.com/HowardHinnant/date.git
synced 2024-12-25 23:40:53 +08:00
Fixed WINRT build - we need convert_utf8_to_utf16 in WINRT mode too
This commit is contained in:
parent
3e43210885
commit
bbe2f51bc0
29
src/tz.cpp
29
src/tz.cpp
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user