From 91216abb7f8756a4697d233c5d49ac9ebc543b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 7 Sep 2013 17:14:49 +0200 Subject: [PATCH] GCC 4.5 compatibility: nullptr-related issues. --- src/Trade/AbstractImporter.cpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/Trade/AbstractImporter.cpp b/src/Trade/AbstractImporter.cpp index f6b8dd3f8..746131086 100644 --- a/src/Trade/AbstractImporter.cpp +++ b/src/Trade/AbstractImporter.cpp @@ -218,7 +218,13 @@ std::unique_ptr AbstractImporter::object2D(const UnsignedInt id) { return doObject2D(id); } -std::unique_ptr AbstractImporter::doObject2D(UnsignedInt) { return nullptr; } +std::unique_ptr AbstractImporter::doObject2D(UnsignedInt) { + #ifndef CORRADE_GCC45_COMPATIBILITY + return nullptr; + #else + return {}; + #endif +} UnsignedInt AbstractImporter::object3DCount() const { CORRADE_ASSERT(isOpened(), "Trade::AbstractImporter::object3DCount(): no file opened", {}); @@ -248,7 +254,13 @@ std::unique_ptr AbstractImporter::object3D(const UnsignedInt id) { return doObject3D(id); } -std::unique_ptr AbstractImporter::doObject3D(UnsignedInt) { return nullptr; } +std::unique_ptr AbstractImporter::doObject3D(UnsignedInt) { + #ifndef CORRADE_GCC45_COMPATIBILITY + return nullptr; + #else + return {}; + #endif +} UnsignedInt AbstractImporter::mesh2DCount() const { CORRADE_ASSERT(isOpened(), "Trade::AbstractImporter::mesh2DCount(): no file opened", {}); @@ -338,7 +350,13 @@ std::unique_ptr AbstractImporter::material(const UnsignedI return doMaterial(id); } -std::unique_ptr AbstractImporter::doMaterial(UnsignedInt) { return nullptr; } +std::unique_ptr AbstractImporter::doMaterial(UnsignedInt) { + #ifndef CORRADE_GCC45_COMPATIBILITY + return nullptr; + #else + return {}; + #endif +} UnsignedInt AbstractImporter::textureCount() const { CORRADE_ASSERT(isOpened(), "Trade::AbstractImporter::textureCount(): no file opened", {});