Browse Source

GCC 4.6 compatibility is now handled by Corrade.

pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
67f2e0fc7f
  1. 5
      CMakeLists.txt
  2. 6
      modules/FindMagnum.cmake
  3. 1
      src/CMakeLists.txt
  4. 2
      src/IndexedMesh.h
  5. 1
      src/Magnum.h
  6. 2
      src/Physics/AxisAlignedBox.h
  7. 2
      src/Physics/Box.h
  8. 2
      src/Physics/Capsule.h
  9. 2
      src/Physics/Implementation/AbstractBoxRenderer.h
  10. 2
      src/Physics/Implementation/AxisAlignedBoxRenderer.h
  11. 2
      src/Physics/Implementation/BoxRenderer.h
  12. 2
      src/Physics/Line.h
  13. 2
      src/Physics/Plane.h
  14. 2
      src/Physics/Point.h
  15. 2
      src/Physics/ShapeGroup.h
  16. 2
      src/Physics/Sphere.h
  17. 4
      src/SceneGraph/AbstractCamera.h
  18. 4
      src/SceneGraph/AbstractFeature.h
  19. 4
      src/SceneGraph/AbstractGroupedFeature.h
  20. 6
      src/SceneGraph/AbstractObject.h
  21. 4
      src/SceneGraph/AbstractTransformation.h
  22. 10
      src/SceneGraph/Drawable.h
  23. 4
      src/SceneGraph/FeatureGroup.h
  24. 18
      src/SceneGraph/SceneGraph.h
  25. 2
      src/Test/ResourceManagerTest.cpp
  26. 24
      src/magnumCompatibility.h
  27. 1
      src/magnumConfigure.h.cmake

5
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})

6
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)

1
src/CMakeLists.txt

@ -79,7 +79,6 @@ set(Magnum_HEADERS
Timeline.h
TypeTraits.h
magnumCompatibility.h
magnumVisibility.h)
# Desktop-only headers

2
src/IndexedMesh.h

@ -21,6 +21,8 @@
#include "Mesh.h"
#include "corradeCompatibility.h"
namespace Magnum {
/**

1
src/Magnum.h

@ -21,6 +21,7 @@
#include <cstdint>
#include "corradeConfigure.h"
#include "magnumConfigure.h"
#ifndef MAGNUM_TARGET_GLES

2
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 {

2
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 {

2
src/Physics/Capsule.h

@ -23,7 +23,7 @@
#include "AbstractShape.h"
#include "Physics.h"
#include "magnumCompatibility.h"
#include "corradeCompatibility.h"
namespace Magnum { namespace Physics {

2
src/Physics/Implementation/AbstractBoxRenderer.h

@ -17,7 +17,7 @@
#include "AbstractDebugRenderer.h"
#include "magnumCompatibility.h"
#include "corradeCompatibility.h"
namespace Magnum {

2
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 {

2
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 {

2
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 {

2
src/Physics/Plane.h

@ -23,7 +23,7 @@
#include "AbstractShape.h"
#include "Physics.h"
#include "magnumCompatibility.h"
#include "corradeCompatibility.h"
namespace Magnum { namespace Physics {

2
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 {

2
src/Physics/ShapeGroup.h

@ -24,7 +24,7 @@
#include <type_traits>
#include <utility>
#include "magnumCompatibility.h"
#include "corradeCompatibility.h"
namespace Magnum { namespace Physics {

2
src/Physics/Sphere.h

@ -23,7 +23,7 @@
#include "AbstractShape.h"
#include "Physics.h"
#include "magnumCompatibility.h"
#include "corradeCompatibility.h"
namespace Magnum { namespace Physics {

4
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<class T = GLfloat> 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<class T = GLfloat> using AbstractCamera3D = AbstractCamera<3, T>;
#endif
#else

4
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<class T = GLfloat> 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<class T = GLfloat> using AbstractFeature3D = AbstractFeature<3, T>;
#endif
#else

4
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<class Derived, class T = GLfloat> 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<class Derived, class T = GLfloat> using AbstractGroupedFeature3D = AbstractGroupedFeature<3, Derived, T>;
#endif
#else

6
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<class T = GLfloat> 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<class T = GLfloat> using AbstractObject3D = AbstractObject<3, T>;
#endif
#else

4
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<class T = GLfloat> 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<class T = GLfloat> using AbstractTransformation3D = AbstractTransformation<3, T>;
#endif
#else

10
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<class T = GLfloat> 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<class T = GLfloat> 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<std::uint8_t dimensions, class T = GLfloat> using DrawableGroup = FeatureGroup<dimensions, Drawable<dimensions, T>, 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<class T = GLfloat> 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<class T = GLfloat> using DrawableGroup3D = DrawableGroup<3, T>;
#endif
#else

4
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<class Feature, class T = GLfloat> 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<class Feature, class T = GLfloat> using FeatureGroup3D = FeatureGroup<3, Feature, T>;
#endif
#else

18
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<std::uint8_t dimensions, class T = GLfloat> class AbstractCamera;
#ifndef MAGNUM_GCC46_COMPATIBILITY
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T = GLfloat> using AbstractCamera2D = AbstractCamera<2, T>;
template<class T = GLfloat> using AbstractCamera3D = AbstractCamera<3, T>;
#endif
template<std::uint8_t dimensions, class T = GLfloat> class AbstractFeature;
#ifndef MAGNUM_GCC46_COMPATIBILITY
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T = GLfloat> using AbstractFeature2D = AbstractFeature<2, T>;
template<class T = GLfloat> using AbstractFeature3D = AbstractFeature<3, T>;
#endif
template<std::uint8_t dimensions, class Derived, class T = GLfloat> class AbstractGroupedFeature;
#ifndef MAGNUM_GCC46_COMPATIBILITY
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class Derived, class T = GLfloat> using AbstractGroupedFeature2D = AbstractGroupedFeature<2, Derived, T>;
template<class Derived, class T = GLfloat> using AbstractGroupedFeature3D = AbstractGroupedFeature<3, Derived, T>;
#endif
template<std::uint8_t dimensions, class T = GLfloat> class AbstractObject;
#ifndef MAGNUM_GCC46_COMPATIBILITY
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T = GLfloat> using AbstractObject2D = AbstractObject<2, T>;
template<class T = GLfloat> using AbstractObject3D = AbstractObject<3, T>;
#endif
@ -54,7 +56,7 @@ template<class T = GLfloat> using AbstractObject3D = AbstractObject<3, T>;
enum class TransformationType: std::uint8_t;
template<std::uint8_t dimensions, class T = GLfloat> class AbstractTransformation;
#ifndef MAGNUM_GCC46_COMPATIBILITY
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T = GLfloat> using AbstractTransformation2D = AbstractTransformation<2, T>;
template<class T = GLfloat> using AbstractTransformation3D = AbstractTransformation<3, T>;
#endif
@ -68,18 +70,18 @@ template<class T = GLfloat> class Camera2D;
template<class T = GLfloat> class Camera3D;
template<std::uint8_t dimensions, class T = GLfloat> class Drawable;
#ifndef MAGNUM_GCC46_COMPATIBILITY
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T = GLfloat> using Drawable2D = Drawable<2, T>;
template<class T = GLfloat> using Drawable3D = Drawable<3, T>;
#endif
template<std::uint8_t dimensions, class Feature, class T = GLfloat> class FeatureGroup;
#ifndef MAGNUM_GCC46_COMPATIBILITY
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class Feature, class T = GLfloat> using FeatureGroup2D = FeatureGroup<2, Feature, T>;
template<class Feature, class T = GLfloat> using FeatureGroup3D = FeatureGroup<3, Feature, T>;
#endif
#ifndef MAGNUM_GCC46_COMPATIBILITY
#ifndef CORRADE_GCC46_COMPATIBILITY
template<std::uint8_t dimensions, class T = GLfloat> using DrawableGroup = FeatureGroup<dimensions, Drawable<dimensions, T>, T>;
template<class T = GLfloat> using DrawableGroup2D = DrawableGroup<2, T>;
template<class T = GLfloat> using DrawableGroup3D = DrawableGroup<3, T>;

2
src/Test/ResourceManagerTest.cpp

@ -20,6 +20,8 @@
#include "AbstractResourceLoader.h"
#include "ResourceManager.h"
#include "corradeCompatibility.h"
using namespace std;
using namespace Corrade::Utility;

24
src/magnumCompatibility.h

@ -1,24 +0,0 @@
#ifndef magnumCompatibility_h
#define magnumCompatibility_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
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

1
src/magnumConfigure.h.cmake

@ -1,4 +1,3 @@
#cmakedefine MAGNUM_TARGET_NACL
#cmakedefine MAGNUM_TARGET_GLES
#cmakedefine MAGNUM_TARGET_GLES2
#cmakedefine MAGNUM_GCC46_COMPATIBILITY

Loading…
Cancel
Save