From e2aa63f25c358583a4687ab733e2a2a8c4c2ce32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 3 Jul 2013 13:26:54 +0200 Subject: [PATCH] GCC 4.5 compatibility: nullptr-related issues. --- src/Text/AbstractFontConverter.cpp | 24 ++++++++++++++++++++++++ src/Trade/AbstractImageConverter.cpp | 9 +++++++++ 2 files changed, 33 insertions(+) diff --git a/src/Text/AbstractFontConverter.cpp b/src/Text/AbstractFontConverter.cpp index 94c626c31..9da53d4aa 100644 --- a/src/Text/AbstractFontConverter.cpp +++ b/src/Text/AbstractFontConverter.cpp @@ -53,17 +53,29 @@ std::vector>> AbstractFo } Containers::Array AbstractFontConverter::exportFontToSingleData(AbstractFont* const font, GlyphCache* const cache, const std::string& characters) const { + #ifndef CORRADE_GCC45_COMPATIBILITY CORRADE_ASSERT(features() >= (Feature::ExportFont|Feature::ConvertData), "Text::AbstractFontConverter::exportFontToSingleData(): feature not supported", nullptr); CORRADE_ASSERT(!(features() & Feature::MultiFile), "Text::AbstractFontConverter::exportFontToSingleData(): the format is not single-file", nullptr); + #else + CORRADE_ASSERT(features() >= (Feature::ExportFont|Feature::ConvertData), + "Text::AbstractFontConverter::exportFontToSingleData(): feature not supported", {}); + CORRADE_ASSERT(!(features() & Feature::MultiFile), + "Text::AbstractFontConverter::exportFontToSingleData(): the format is not single-file", {}); + #endif return doExportFontToSingleData(font, cache, uniqueUnicode(characters)); } Containers::Array AbstractFontConverter::doExportFontToSingleData(AbstractFont*, GlyphCache*, const std::u32string&) const { + #ifndef CORRADE_GCC45_COMPATIBILITY CORRADE_ASSERT(false, "Text::AbstractFontConverter::exportFontToSingleData(): feature advertised but not implemented", nullptr); + #else + CORRADE_ASSERT(false, + "Text::AbstractFontConverter::exportFontToSingleData(): feature advertised but not implemented", {}); + #endif } bool AbstractFontConverter::exportFontToFile(AbstractFont* const font, GlyphCache* const cache, const std::string& filename, const std::string& characters) const { @@ -111,17 +123,29 @@ std::vector>> AbstractFo } Containers::Array AbstractFontConverter::exportGlyphCacheToSingleData(GlyphCache* cache) const { + #ifndef CORRADE_GCC45_COMPATIBILITY CORRADE_ASSERT(features() >= (Feature::ExportGlyphCache|Feature::ConvertData), "Text::AbstractFontConverter::exportGlyphCacheToSingleData(): feature not supported", nullptr); CORRADE_ASSERT(!(features() & Feature::MultiFile), "Text::AbstractFontConverter::exportGlyphCacheToSingleData(): the format is not single-file", nullptr); + #else + CORRADE_ASSERT(features() >= (Feature::ExportGlyphCache|Feature::ConvertData), + "Text::AbstractFontConverter::exportGlyphCacheToSingleData(): feature not supported", {}); + CORRADE_ASSERT(!(features() & Feature::MultiFile), + "Text::AbstractFontConverter::exportGlyphCacheToSingleData(): the format is not single-file", {}); + #endif return doExportGlyphCacheToSingleData(cache); } Containers::Array AbstractFontConverter::doExportGlyphCacheToSingleData(GlyphCache*) const { + #ifndef CORRADE_GCC45_COMPATIBILITY CORRADE_ASSERT(false, "Text::AbstractFontConverter::exportGlyphCacheToSingleData(): feature advertised but not implemented", nullptr); + #else + CORRADE_ASSERT(false, + "Text::AbstractFontConverter::exportGlyphCacheToSingleData(): feature advertised but not implemented", {}); + #endif } bool AbstractFontConverter::exportGlyphCacheToFile(GlyphCache* cache, const std::string& filename) const { diff --git a/src/Trade/AbstractImageConverter.cpp b/src/Trade/AbstractImageConverter.cpp index d0a465f68..cb54abc45 100644 --- a/src/Trade/AbstractImageConverter.cpp +++ b/src/Trade/AbstractImageConverter.cpp @@ -46,14 +46,23 @@ Image2D* AbstractImageConverter::doExportToImage(const Image2D*) const { } Containers::Array AbstractImageConverter::exportToData(const Image2D* const image) const { + #ifndef CORRADE_GCC45_COMPATIBILITY CORRADE_ASSERT(features() & Feature::ConvertData, "Trade::AbstractImageConverter::exportToData(): feature not supported", nullptr); + #else + CORRADE_ASSERT(features() & Feature::ConvertData, + "Trade::AbstractImageConverter::exportToData(): feature not supported", {}); + #endif return doExportToData(image); } Containers::Array AbstractImageConverter::doExportToData(const Image2D*) const { + #ifndef CORRADE_GCC45_COMPATIBILITY CORRADE_ASSERT(false, "Trade::AbstractImageConverter::exportToData(): feature advertised but not implemented", nullptr); + #else + CORRADE_ASSERT(false, "Trade::AbstractImageConverter::exportToData(): feature advertised but not implemented", {}); + #endif } bool AbstractImageConverter::exportToFile(const Image2D* const image, const std::string& filename) const {