From 4e847b7fccf5337a48db050fc94aecf7ced44601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 5 Jul 2012 23:00:57 +0200 Subject: [PATCH] GCC 4.4 compatibility: worked around "Sorry, not implemented" error. New function declaration syntax for deduced return types doesn't work here fully yet. --- src/MeshTools/CompressIndices.h | 4 ++++ src/SizeTraits.h | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/MeshTools/CompressIndices.h b/src/MeshTools/CompressIndices.h index 554b5088c..29a64d62d 100644 --- a/src/MeshTools/CompressIndices.h +++ b/src/MeshTools/CompressIndices.h @@ -38,7 +38,11 @@ class CompressIndices { CompressIndices(const std::vector& indices): indices(indices) {} inline std::tuple operator()() const { + #ifndef MAGNUM_GCC44_COMPATIBILITY return SizeBasedCall(*std::max_element(indices.begin(), indices.end()))(indices); + #else + return SizeBasedCall, Compressor>(*std::max_element(indices.begin(), indices.end()))(indices); + #endif } void operator()(IndexedMesh* mesh, Buffer::Usage usage) const { diff --git a/src/SizeTraits.h b/src/SizeTraits.h index 3842f2c37..6e6808f2c 100644 --- a/src/SizeTraits.h +++ b/src/SizeTraits.h @@ -101,7 +101,11 @@ based on data size: bar = SizeBasedCall(dataSize)(arg1, arg2, ...); @endcode */ +#ifndef MAGNUM_GCC44_COMPATIBILITY template struct SizeBasedCall: public Base { +#else +template struct SizeBasedCall: public Base { +#endif /** * @brief Constructor * @param size Data size @@ -120,7 +124,11 @@ template struct SizeBasedCall: public Base { #ifndef MAGNUM_GCC45_COMPATIBILITY template auto operator()(Args&&... arguments) -> decltype(Base::template run(std::forward(arguments)...)) { #else + #ifdef MAGNUM_GCC44_COMPATIBILITY + template Return operator()(Args&& arguments) { + #else template auto operator()(Args&& arguments) -> decltype(Base::template run(std::forward(arguments))) { + #endif #endif switch(Math::log(256, size)) { case 0: @@ -148,8 +156,12 @@ template struct SizeBasedCall: public Base { #ifndef MAGNUM_GCC45_COMPATIBILITY return decltype(Base::template run(std::forward(arguments)...))(); #else + #ifdef MAGNUM_GCC44_COMPATIBILITY + return Return(); + #else return decltype(Base::template run(std::forward(arguments)))(); #endif + #endif } private: