diff --git a/doc/changelog.dox b/doc/changelog.dox index 2b2b2b921..e1fd41708 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -945,6 +945,9 @@ See also: [mosra/toolchains#13](https://github.com/mosra/toolchains/issues/13), [mosra/toolchains#14](https://github.com/mosra/toolchains/pull/14) and [mosra/magnum#490](https://github.com/mosra/magnum/issues/490). +- @ref Platform::Sdl2Application and @ref Platform::EmscriptenApplication now + use `UTF8ToString` instead of `AsciiToString` as the latter is no longer + included by default on Emscripten 3.1.21+ (see [mosra/magnum#619](https://github.com/mosra/magnum/issues/619)). @subsection changelog-latest-bugfixes Bug fixes diff --git a/src/Magnum/Platform/EmscriptenApplication.cpp b/src/Magnum/Platform/EmscriptenApplication.cpp index 2f6c822f6..4af13d7a9 100644 --- a/src/Magnum/Platform/EmscriptenApplication.cpp +++ b/src/Magnum/Platform/EmscriptenApplication.cpp @@ -486,11 +486,7 @@ void EmscriptenApplication::setContainerCssClass(const Containers::StringView cs EM_ASM_({ /* Handle also the classic #container for backwards compatibility. We also need to preserve the mn-container otherwise next time we'd have - no way to look for it anymore. - - Using UTF8ToString() instead of AsciiToString() as it has an - explicit size parameter and thus doesn't need a null-terminated - input, which would potentially require yet another allocation. */ + no way to look for it anymore. */ (Module['canvas'].closest('.mn-container') || document.getElementById('container')).className = (['mn-container', UTF8ToString($0, $1)]).join(' '); }, cssClass.data(), cssClass.size()); @@ -745,7 +741,7 @@ void EmscriptenApplication::setCursor(Cursor cursor) { CORRADE_INTERNAL_ASSERT(UnsignedInt(cursor) < Containers::arraySize(CursorMap)); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdollar-in-identifier-extension" - EM_ASM_({Module['canvas'].style.cursor = AsciiToString($0);}, CursorMap[UnsignedInt(cursor)]); + EM_ASM_({Module['canvas'].style.cursor = UTF8ToString($0);}, CursorMap[UnsignedInt(cursor)]); #pragma GCC diagnostic pop } diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 7407a8b2d..cab1cc188 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -771,11 +771,7 @@ void Sdl2Application::setContainerCssClass(const Containers::StringView cssClass EM_ASM_({ /* Handle also the classic #container for backwards compatibility. We also need to preserve the mn-container otherwise next time we'd have - no way to look for it anymore. - - Using UTF8ToString() instead of AsciiToString() as it has an - explicit size parameter and thus doesn't need a null-terminated - input, which would potentially require yet another allocation. */ + no way to look for it anymore. */ (Module['canvas'].closest('.mn-container') || document.getElementById('container')).className = (['mn-container', UTF8ToString($0, $1)]).join(' '); }, cssClass.data(), cssClass.size()); @@ -1122,7 +1118,7 @@ void Sdl2Application::setCursor(Cursor cursor) { CORRADE_INTERNAL_ASSERT(UnsignedInt(cursor) < Containers::arraySize(CursorMap)); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdollar-in-identifier-extension" - EM_ASM_({Module['canvas'].style.cursor = AsciiToString($0);}, CursorMap[UnsignedInt(cursor)]); + EM_ASM_({Module['canvas'].style.cursor = UTF8ToString($0);}, CursorMap[UnsignedInt(cursor)]); #pragma GCC diagnostic pop #endif }