From c01dc81d0415c0e2033b4962e6df6a11510d5d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 21 Mar 2020 19:48:44 +0100 Subject: [PATCH] GCC 4.8, stay alive for a few more days please. --- doc/snippets/MagnumShaders.cpp | 6 ++++++ .../Primitives/Implementation/Spheroid.cpp | 20 +++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/doc/snippets/MagnumShaders.cpp b/doc/snippets/MagnumShaders.cpp index 13a152faf..7ab1a1e4e 100644 --- a/doc/snippets/MagnumShaders.cpp +++ b/doc/snippets/MagnumShaders.cpp @@ -50,6 +50,8 @@ using namespace Magnum::Math::Literals; int main() { +/* internal compiler error: in gimplify_init_constructor, at gimplify.c:4271 + on GCC 4.8 in the [60] array */ #if !defined(__GNUC__) || defined(__clang__) || __GNUC__*100 + __GNUC_MINOR__ >= 500 { /* [shaders-setup] */ @@ -285,6 +287,9 @@ mesh.addVertexBuffer(vertexIndices, 0, Shaders::MeshVisualizer3D::VertexIndex{}) #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) +/* internal compiler error: in gimplify_init_constructor, at gimplify.c:4271 + on GCC 4.8 in the [60] array */ +#if !defined(__GNUC__) || defined(__clang__) || __GNUC__*100 + __GNUC_MINOR__ >= 500 { /* [MeshVisualizer-usage-tbn1] */ struct Vertex { @@ -323,6 +328,7 @@ shader.setViewportSize(Vector2{GL::defaultFramebuffer.viewport().size()}) } #endif +#endif { /* [MeshVisualizer-usage-no-geom1] */ diff --git a/src/Magnum/Primitives/Implementation/Spheroid.cpp b/src/Magnum/Primitives/Implementation/Spheroid.cpp index 9863fbdd7..bf5d7da87 100644 --- a/src/Magnum/Primitives/Implementation/Spheroid.cpp +++ b/src/Magnum/Primitives/Implementation/Spheroid.cpp @@ -247,27 +247,31 @@ Trade::MeshData Spheroid::finalize() { Containers::Array attributes{_attributeCount}; attributes[attributeOffset++] = Trade::MeshAttributeData{ Trade::MeshAttribute::Position, VertexFormat::Vector3, - Containers::stridedArrayView(_vertexData, + /* GCC 4.8 can't handle the stridedArrayView() convenience thing */ + Containers::StridedArrayView1D{_vertexData, _vertexData.data(), - _vertexData.size()/_stride, std::ptrdiff_t(_stride))}; + _vertexData.size()/_stride, std::ptrdiff_t(_stride)}}; attributes[attributeOffset++] = Trade::MeshAttributeData{ Trade::MeshAttribute::Normal, VertexFormat::Vector3, - Containers::stridedArrayView(_vertexData, + /* GCC 4.8 can't handle the stridedArrayView() convenience thing */ + Containers::StridedArrayView1D{_vertexData, _vertexData.data() + sizeof(Vector3), - _vertexData.size()/_stride, std::ptrdiff_t(_stride))}; + _vertexData.size()/_stride, std::ptrdiff_t(_stride)}}; if(_flags & Flag::Tangents) attributes[attributeOffset++] = Trade::MeshAttributeData{ Trade::MeshAttribute::Tangent, VertexFormat::Vector4, - Containers::stridedArrayView(_vertexData, + /* GCC 4.8 can't handle the stridedArrayView() convenience thing */ + Containers::StridedArrayView1D{_vertexData, _vertexData.data() + _tangentOffset, - _vertexData.size()/_stride, std::ptrdiff_t(_stride))}; + _vertexData.size()/_stride, std::ptrdiff_t(_stride)}}; if(_flags & Flag::TextureCoordinates) attributes[attributeOffset++] = Trade::MeshAttributeData{ Trade::MeshAttribute::TextureCoordinates, VertexFormat::Vector2, - Containers::stridedArrayView(_vertexData, + /* GCC 4.8 can't handle the stridedArrayView() convenience thing */ + Containers::StridedArrayView1D{_vertexData, _vertexData.data() + _textureCoordinateOffset, - _vertexData.size()/_stride, std::ptrdiff_t(_stride))}; + _vertexData.size()/_stride, std::ptrdiff_t(_stride)}}; CORRADE_INTERNAL_ASSERT(attributeOffset == _attributeCount);