Skip to content

Commit

Permalink
Trade: c'mon, old compilers.
Browse files Browse the repository at this point in the history
  • Loading branch information
mosra committed Apr 17, 2020
1 parent f63dad2 commit 903ca6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doc/snippets/MagnumTrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ using namespace Magnum::Math::Literals;

int main() {

/* GCC 4.8 and Clang 3.8 has problems with an implicit cast here */
#if (defined(CORRADE_TARGET_UNIX) || (defined(CORRADE_TARGET_WINDOWS) && !defined(CORRADE_TARGET_WINDOWS_RT))) && (!defined(CORRADE_TARGET_GCC) || __GNUC__ > 5 || (!defined(CORRADE_TARGET_APPLE_CLANG) && __clang_major__ >= 4) || (defined(CORRADE_TARGET_APPLE_CLANG) && __clang_major__ >= 9))
{
/* [blob-deserialize-mesh] */
Containers::Array<const char, Utility::Directory::MapDeleter> blob =
Expand All @@ -76,6 +78,7 @@ if(!spaceship) Fatal{} << "oh no";
// ...
/* [blob-deserialize-mesh] */
}
#endif

{
/* [AbstractImporter-usage] */
Expand Down
3 changes: 2 additions & 1 deletion src/Magnum/Trade/sceneconverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ class BlobImporter: public Trade::AbstractImporter {

UnsignedInt doMeshCount() const override { return 1; }
Containers::Optional<Trade::MeshData> doMesh(UnsignedInt, UnsignedInt) override {
return Trade::MeshData::deserialize(_in);
/* GCC 4.8 and old Clang has problems with an implicit cast here */
return Trade::MeshData::deserialize(Containers::ArrayView<const void>(_in));
}

Containers::Array<const char, Utility::Directory::MapDeleter> _in;
Expand Down

0 comments on commit 903ca6a

Please sign in to comment.