Skip to content

Commit

Permalink
Build: Suppress warnings about deprecated std::codecvt_utf8_utf16 (#3710
Browse files Browse the repository at this point in the history
)

Another fix for the latest Apple clang, continuing #3709 (I missed
these other spots).
  • Loading branch information
lgritz authored Dec 16, 2022
1 parent 8efd666 commit 55fa360
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit 55fa360

Please sign in to comment.