From 67f2e0fc7fee11a95eeaa3872c3b5576efa33e21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 28 Nov 2012 20:30:28 +0100 Subject: [PATCH] GCC 4.6 compatibility is now handled by Corrade. --- CMakeLists.txt | 5 ---- modules/FindMagnum.cmake | 6 ----- src/CMakeLists.txt | 1 - src/IndexedMesh.h | 2 ++ src/Magnum.h | 1 + src/Physics/AxisAlignedBox.h | 2 +- src/Physics/Box.h | 2 +- src/Physics/Capsule.h | 2 +- .../Implementation/AbstractBoxRenderer.h | 2 +- .../Implementation/AxisAlignedBoxRenderer.h | 2 +- src/Physics/Implementation/BoxRenderer.h | 2 +- src/Physics/Line.h | 2 +- src/Physics/Plane.h | 2 +- src/Physics/Point.h | 2 +- src/Physics/ShapeGroup.h | 2 +- src/Physics/Sphere.h | 2 +- src/SceneGraph/AbstractCamera.h | 4 ++-- src/SceneGraph/AbstractFeature.h | 4 ++-- src/SceneGraph/AbstractGroupedFeature.h | 4 ++-- src/SceneGraph/AbstractObject.h | 6 ++--- src/SceneGraph/AbstractTransformation.h | 4 ++-- src/SceneGraph/Drawable.h | 10 ++++---- src/SceneGraph/FeatureGroup.h | 4 ++-- src/SceneGraph/SceneGraph.h | 18 +++++++------- src/Test/ResourceManagerTest.cpp | 2 ++ src/magnumCompatibility.h | 24 ------------------- src/magnumConfigure.h.cmake | 1 - 27 files changed, 43 insertions(+), 75 deletions(-) delete mode 100644 src/magnumCompatibility.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fd72c8ec..5c54c7c86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,8 +4,6 @@ project(Magnum) include(CMakeDependentOption) -option(GCC46_COMPATIBILITY "Enable compatibility mode for GCC 4.6 (might disable some features)" OFF) - option(TARGET_GLES "Build for OpenGL ES instead of desktop OpenGL" OFF) cmake_dependent_option(TARGET_GLES2 "Build for OpenGL ES 2" ON "TARGET_GLES" OFF) @@ -55,9 +53,6 @@ endif() if(TARGET_GLES2) set(MAGNUM_TARGET_GLES2 1) endif() -if(GCC46_COMPATIBILITY) - set(MAGNUM_GCC46_COMPATIBILITY 1) -endif() # Installation paths set(MAGNUM_LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 951afd188..c3f68d972 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -67,12 +67,6 @@ find_path(MAGNUM_INCLUDE_DIR # Configuration file(READ ${MAGNUM_INCLUDE_DIR}/magnumConfigure.h _magnumConfigure) -# Compatibility? -string(FIND "${_magnumConfigure}" "#define MAGNUM_GCC46_COMPATIBILITY" _GCC46_COMPATIBILITY) -if(NOT _GCC46_COMPATIBILITY EQUAL -1) - set(MAGNUM_GCC46_COMPATIBILITY 1) -endif() - # Built for specific target? string(FIND "${_magnumConfigure}" "#define MAGNUM_TARGET_GLES" _TARGET_GLES) if(NOT _TARGET_GLES EQUAL -1) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bbb9506dc..4e9051cd8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -79,7 +79,6 @@ set(Magnum_HEADERS Timeline.h TypeTraits.h - magnumCompatibility.h magnumVisibility.h) # Desktop-only headers diff --git a/src/IndexedMesh.h b/src/IndexedMesh.h index bac40636e..0d5bfd045 100644 --- a/src/IndexedMesh.h +++ b/src/IndexedMesh.h @@ -21,6 +21,8 @@ #include "Mesh.h" +#include "corradeCompatibility.h" + namespace Magnum { /** diff --git a/src/Magnum.h b/src/Magnum.h index 363d6d97c..6635feb97 100644 --- a/src/Magnum.h +++ b/src/Magnum.h @@ -21,6 +21,7 @@ #include +#include "corradeConfigure.h" #include "magnumConfigure.h" #ifndef MAGNUM_TARGET_GLES diff --git a/src/Physics/AxisAlignedBox.h b/src/Physics/AxisAlignedBox.h index b94a1c70e..15f96d1c3 100644 --- a/src/Physics/AxisAlignedBox.h +++ b/src/Physics/AxisAlignedBox.h @@ -22,7 +22,7 @@ #include "Math/Vector3.h" #include "AbstractShape.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Physics { diff --git a/src/Physics/Box.h b/src/Physics/Box.h index 828f9e2af..272236540 100644 --- a/src/Physics/Box.h +++ b/src/Physics/Box.h @@ -23,7 +23,7 @@ #include "Math/Matrix4.h" #include "AbstractShape.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Physics { diff --git a/src/Physics/Capsule.h b/src/Physics/Capsule.h index f279985de..e2ff9da69 100644 --- a/src/Physics/Capsule.h +++ b/src/Physics/Capsule.h @@ -23,7 +23,7 @@ #include "AbstractShape.h" #include "Physics.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Physics { diff --git a/src/Physics/Implementation/AbstractBoxRenderer.h b/src/Physics/Implementation/AbstractBoxRenderer.h index 87c57687e..f6ed912f7 100644 --- a/src/Physics/Implementation/AbstractBoxRenderer.h +++ b/src/Physics/Implementation/AbstractBoxRenderer.h @@ -17,7 +17,7 @@ #include "AbstractDebugRenderer.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { diff --git a/src/Physics/Implementation/AxisAlignedBoxRenderer.h b/src/Physics/Implementation/AxisAlignedBoxRenderer.h index 5ee7062ec..7eae09acf 100644 --- a/src/Physics/Implementation/AxisAlignedBoxRenderer.h +++ b/src/Physics/Implementation/AxisAlignedBoxRenderer.h @@ -19,7 +19,7 @@ #include "Physics/AxisAlignedBox.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Physics { namespace Implementation { diff --git a/src/Physics/Implementation/BoxRenderer.h b/src/Physics/Implementation/BoxRenderer.h index 4513155c1..ef67869fd 100644 --- a/src/Physics/Implementation/BoxRenderer.h +++ b/src/Physics/Implementation/BoxRenderer.h @@ -19,7 +19,7 @@ #include "Physics/Box.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Physics { namespace Implementation { diff --git a/src/Physics/Line.h b/src/Physics/Line.h index 9246133a4..9230be376 100644 --- a/src/Physics/Line.h +++ b/src/Physics/Line.h @@ -22,7 +22,7 @@ #include "Math/Vector3.h" #include "AbstractShape.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Physics { diff --git a/src/Physics/Plane.h b/src/Physics/Plane.h index 4a622ec58..07cc7ad68 100644 --- a/src/Physics/Plane.h +++ b/src/Physics/Plane.h @@ -23,7 +23,7 @@ #include "AbstractShape.h" #include "Physics.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Physics { diff --git a/src/Physics/Point.h b/src/Physics/Point.h index 5c8e48574..741874ad6 100644 --- a/src/Physics/Point.h +++ b/src/Physics/Point.h @@ -22,7 +22,7 @@ #include "Math/Vector3.h" #include "AbstractShape.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Physics { diff --git a/src/Physics/ShapeGroup.h b/src/Physics/ShapeGroup.h index 88fd7bd1b..d1ed8bce6 100644 --- a/src/Physics/ShapeGroup.h +++ b/src/Physics/ShapeGroup.h @@ -24,7 +24,7 @@ #include #include -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Physics { diff --git a/src/Physics/Sphere.h b/src/Physics/Sphere.h index 083fea64e..24b4dd074 100644 --- a/src/Physics/Sphere.h +++ b/src/Physics/Sphere.h @@ -23,7 +23,7 @@ #include "AbstractShape.h" #include "Physics.h" -#include "magnumCompatibility.h" +#include "corradeCompatibility.h" namespace Magnum { namespace Physics { diff --git a/src/SceneGraph/AbstractCamera.h b/src/SceneGraph/AbstractCamera.h index e5a3793f6..8af0eec73 100644 --- a/src/SceneGraph/AbstractCamera.h +++ b/src/SceneGraph/AbstractCamera.h @@ -173,7 +173,7 @@ for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractCamera2D = AbstractCamera<2, T>; #endif #else @@ -190,7 +190,7 @@ for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractCamera3D = AbstractCamera<3, T>; #endif #else diff --git a/src/SceneGraph/AbstractFeature.h b/src/SceneGraph/AbstractFeature.h index 9e29b77a6..4506c2d4f 100644 --- a/src/SceneGraph/AbstractFeature.h +++ b/src/SceneGraph/AbstractFeature.h @@ -294,7 +294,7 @@ for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractFeature2D = AbstractFeature<2, T>; #endif #else @@ -311,7 +311,7 @@ for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractFeature3D = AbstractFeature<3, T>; #endif #else diff --git a/src/SceneGraph/AbstractGroupedFeature.h b/src/SceneGraph/AbstractGroupedFeature.h index c88379183..ffe33b1be 100644 --- a/src/SceneGraph/AbstractGroupedFeature.h +++ b/src/SceneGraph/AbstractGroupedFeature.h @@ -103,7 +103,7 @@ AbstractGroupedFeature for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractGroupedFeature2D = AbstractGroupedFeature<2, Derived, T>; #endif #else @@ -121,7 +121,7 @@ AbstractGroupedFeature for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractGroupedFeature3D = AbstractGroupedFeature<3, Derived, T>; #endif #else diff --git a/src/SceneGraph/AbstractObject.h b/src/SceneGraph/AbstractObject.h index 695ee1efe..08f9a4ac5 100644 --- a/src/SceneGraph/AbstractObject.h +++ b/src/SceneGraph/AbstractObject.h @@ -25,8 +25,6 @@ #include "DimensionTraits.h" #include "SceneGraph.h" -#include "magnumCompatibility.h" - namespace Magnum { namespace SceneGraph { /** @@ -190,7 +188,7 @@ for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractObject2D = AbstractObject<2, T>; #endif #else @@ -207,7 +205,7 @@ for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractObject3D = AbstractObject<3, T>; #endif #else diff --git a/src/SceneGraph/AbstractTransformation.h b/src/SceneGraph/AbstractTransformation.h index 31dc26409..718d6c09f 100644 --- a/src/SceneGraph/AbstractTransformation.h +++ b/src/SceneGraph/AbstractTransformation.h @@ -149,7 +149,7 @@ AbstractTransformation for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractTransformation2D = AbstractTransformation<2, T>; #endif #else @@ -167,7 +167,7 @@ AbstractTransformation for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractTransformation3D = AbstractTransformation<3, T>; #endif #else diff --git a/src/SceneGraph/Drawable.h b/src/SceneGraph/Drawable.h index 983d48716..9eaca737b 100644 --- a/src/SceneGraph/Drawable.h +++ b/src/SceneGraph/Drawable.h @@ -108,7 +108,7 @@ information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using Drawable2D = Drawable<2, T>; #endif #else @@ -125,7 +125,7 @@ information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using Drawable3D = Drawable<3, T>; #endif #else @@ -139,7 +139,7 @@ See Drawable for more information. @see DrawableGroup2D, DrawableGroup3D @todoc Remove workaround when Doxygen supports alias template */ -#if !defined(MAGNUM_GCC46_COMPATIBILITY) && !defined(DOXYGEN_GENERATING_OUTPUT) +#if !defined(CORRADE_GCC46_COMPATIBILITY) && !defined(DOXYGEN_GENERATING_OUTPUT) template using DrawableGroup = FeatureGroup, T>; #else #ifndef DOXYGEN_GENERATING_OUTPUT @@ -160,7 +160,7 @@ more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using DrawableGroup2D = DrawableGroup<2, T>; #endif #else @@ -177,7 +177,7 @@ more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using DrawableGroup3D = DrawableGroup<3, T>; #endif #else diff --git a/src/SceneGraph/FeatureGroup.h b/src/SceneGraph/FeatureGroup.h index a6c32c703..6ff5cd9c7 100644 --- a/src/SceneGraph/FeatureGroup.h +++ b/src/SceneGraph/FeatureGroup.h @@ -119,7 +119,7 @@ AbstractGroupedFeature for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using FeatureGroup2D = FeatureGroup<2, Feature, T>; #endif #else @@ -137,7 +137,7 @@ AbstractGroupedFeature for more information. @todoc Remove workaround when Doxygen supports alias template */ #ifndef DOXYGEN_GENERATING_OUTPUT -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using FeatureGroup3D = FeatureGroup<3, Feature, T>; #endif #else diff --git a/src/SceneGraph/SceneGraph.h b/src/SceneGraph/SceneGraph.h index d6a5337f0..e8e7bd6ad 100644 --- a/src/SceneGraph/SceneGraph.h +++ b/src/SceneGraph/SceneGraph.h @@ -23,30 +23,32 @@ #include "Magnum.h" +#include "corradeCompatibility.h" + namespace Magnum { namespace SceneGraph { enum class AspectRatioPolicy: std::uint8_t; template class AbstractCamera; -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractCamera2D = AbstractCamera<2, T>; template using AbstractCamera3D = AbstractCamera<3, T>; #endif template class AbstractFeature; -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractFeature2D = AbstractFeature<2, T>; template using AbstractFeature3D = AbstractFeature<3, T>; #endif template class AbstractGroupedFeature; -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractGroupedFeature2D = AbstractGroupedFeature<2, Derived, T>; template using AbstractGroupedFeature3D = AbstractGroupedFeature<3, Derived, T>; #endif template class AbstractObject; -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractObject2D = AbstractObject<2, T>; template using AbstractObject3D = AbstractObject<3, T>; #endif @@ -54,7 +56,7 @@ template using AbstractObject3D = AbstractObject<3, T>; enum class TransformationType: std::uint8_t; template class AbstractTransformation; -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using AbstractTransformation2D = AbstractTransformation<2, T>; template using AbstractTransformation3D = AbstractTransformation<3, T>; #endif @@ -68,18 +70,18 @@ template class Camera2D; template class Camera3D; template class Drawable; -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using Drawable2D = Drawable<2, T>; template using Drawable3D = Drawable<3, T>; #endif template class FeatureGroup; -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using FeatureGroup2D = FeatureGroup<2, Feature, T>; template using FeatureGroup3D = FeatureGroup<3, Feature, T>; #endif -#ifndef MAGNUM_GCC46_COMPATIBILITY +#ifndef CORRADE_GCC46_COMPATIBILITY template using DrawableGroup = FeatureGroup, T>; template using DrawableGroup2D = DrawableGroup<2, T>; template using DrawableGroup3D = DrawableGroup<3, T>; diff --git a/src/Test/ResourceManagerTest.cpp b/src/Test/ResourceManagerTest.cpp index 9b87ea360..bd73a6b5b 100644 --- a/src/Test/ResourceManagerTest.cpp +++ b/src/Test/ResourceManagerTest.cpp @@ -20,6 +20,8 @@ #include "AbstractResourceLoader.h" #include "ResourceManager.h" +#include "corradeCompatibility.h" + using namespace std; using namespace Corrade::Utility; diff --git a/src/magnumCompatibility.h b/src/magnumCompatibility.h deleted file mode 100644 index c69691732..000000000 --- a/src/magnumCompatibility.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef magnumCompatibility_h -#define magnumCompatibility_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - This file is part of Magnum. - - Magnum is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License version 3 - only, as published by the Free Software Foundation. - - Magnum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License version 3 for more details. -*/ - -#include "magnumConfigure.h" - -#ifdef MAGNUM_GCC46_COMPATIBILITY -#define override -#endif - -#endif diff --git a/src/magnumConfigure.h.cmake b/src/magnumConfigure.h.cmake index 3296b3c10..5738c3961 100644 --- a/src/magnumConfigure.h.cmake +++ b/src/magnumConfigure.h.cmake @@ -1,4 +1,3 @@ #cmakedefine MAGNUM_TARGET_NACL #cmakedefine MAGNUM_TARGET_GLES #cmakedefine MAGNUM_TARGET_GLES2 -#cmakedefine MAGNUM_GCC46_COMPATIBILITY