From bbe2f51bc035b92094300f8bbefdeb1345e9078d Mon Sep 17 00:00:00 2001 From: Eugene Golushkov Date: Wed, 18 Oct 2023 16:50:44 +0200 Subject: [PATCH] Fixed WINRT build - we need convert_utf8_to_utf16 in WINRT mode too --- src/tz.cpp | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/tz.cpp b/src/tz.cpp index 8e639b8..345afa8 100644 --- a/src/tz.cpp +++ b/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; -} 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; +} + // 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