Skip to content

Build: Suppress warnings about deprecated std::codecvt_utf8_utf16 #3710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/libutil/strutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,10 @@ std::string
Strutil::utf16_to_utf8(const std::wstring& str) noexcept
{
try {
OIIO_PRAGMA_WARNING_PUSH
OIIO_CLANG_PRAGMA(GCC diagnostic ignored "-Wdeprecated-declarations")
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t> conv;
OIIO_PRAGMA_WARNING_POP
return conv.to_bytes(str);
} catch (const std::exception&) {
return std::string();
Expand All @@ -921,7 +924,10 @@ std::string
Strutil::utf16_to_utf8(const std::u16string& str) noexcept
{
try {
OIIO_PRAGMA_WARNING_PUSH
OIIO_CLANG_PRAGMA(GCC diagnostic ignored "-Wdeprecated-declarations")
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> conv;
OIIO_PRAGMA_WARNING_POP
return conv.to_bytes(str);
} catch (const std::exception&) {
return std::string();
Expand Down