diff --git a/doc/changelog.dox b/doc/changelog.dox index 75c865124..bef5904d8 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -177,6 +177,11 @@ See also: - Fixed broken @ref Platform::EmscriptenApplication mouse event coordinates when `-s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1` is enabled (see [mosra/magnum#408](https://github.com/mosra/magnum/issues/408)) +- In 2019.01 @ref Magnum/Platform/Sdl2Application.h went through an include + cleanup, removing 50k lines; but unfortunately we forgot to add back + @cpp #include  @ce, causing iOS builds to fail to initialize. + The include got added back and initialization failures are reported with + more information now. @subsection changelog-latest-deprecated Deprecated APIs diff --git a/doc/snippets/MagnumGL-framebuffer.cpp b/doc/snippets/MagnumGL-framebuffer.cpp index 33ad6f045..9f424de88 100644 --- a/doc/snippets/MagnumGL-framebuffer.cpp +++ b/doc/snippets/MagnumGL-framebuffer.cpp @@ -97,4 +97,5 @@ GL::Buffer b; // implicitly tied to `other` /* [Context-makeCurrent] */ } +return 0; /* on iOS SDL redefines main to SDL_main and then return is needed */ } diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index 6ac7dcb9a..5832adbfe 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -61,6 +61,16 @@ #include #include +#ifdef CORRADE_TARGET_IOS +/* Including SDL_main.h unconditionally would mean it'd override Corrade::Main + on Windows (both are parsing wargv and converting them to UTF-8, but ours + does that better and additionally enables ANSI colors and UTF-8 console + output). Right now (SDL 2.0.11) it's only needed for WinRT (which is done + below), Android (which we don't support for SDL) and iOS, so whitelist it + only for iOS. */ +#include +#endif + #ifdef CORRADE_TARGET_WINDOWS_RT #include /* For SDL_WinRTRunApp */ #include /* For the WinMain entrypoint */