From 7c2cbdb0bd8cb132d7b458c5766e28600a45b236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 29 Apr 2015 01:13:55 +0200 Subject: [PATCH] GCC 4.5 compatibility: this is like five bugs and segfault at once. --- src/Magnum/Test/MeshGLTest.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Test/MeshGLTest.cpp b/src/Magnum/Test/MeshGLTest.cpp index a29a0994e..52dc4c864 100644 --- a/src/Magnum/Test/MeshGLTest.cpp +++ b/src/Magnum/Test/MeshGLTest.cpp @@ -465,7 +465,11 @@ Checker::Checker(AbstractShaderProgram&& shader, RenderbufferFormat format, Mesh } template T Checker::get(ColorFormat format, ColorType type) { - return framebuffer.read({{}, Vector2i{1}}, {format, type}).data()[0]; + /* GCC 4.5 needs explicit type here and also cannot handle && ref, also + crashes when using {} */ + Image2D image{format, type}; + framebuffer.read(Range2Di({}, Vector2i{1}), image); + return image.data()[0]; } #endif @@ -1758,7 +1762,11 @@ MultiChecker::MultiChecker(AbstractShaderProgram&& shader, Mesh& mesh): framebuf } template T MultiChecker::get(ColorFormat format, ColorType type) { - return framebuffer.read({{}, Vector2i{1}}, {format, type}).data()[0]; + /* GCC 4.5 needs explicit type here and also cannot handle &&, also crashes + when using {} */ + Image2D image{format, type}; + framebuffer.read(Range2Di({}, Vector2i{1}), image); + return image.data()[0]; } #endif