Browse Source

Dropped GCC 4.6 support.

pull/59/head
Vladimír Vondruš 12 years ago
parent
commit
a9a5ead13d
  1. 4
      CMakeLists.txt
  2. 6
      README.md
  3. 8
      doc/building.dox
  4. 2
      doc/portability.dox
  5. 56
      package/archlinux/PKGBUILD-gcc46
  6. 1
      package/ci/jenkins-gltests.xml
  7. 1
      package/ci/jenkins.xml
  8. 7
      src/CMakeLists.txt
  9. 6
      src/Magnum/Array.h
  10. 4
      src/Magnum/Context.cpp
  11. 9
      src/Magnum/DebugTools/ForceRenderer.cpp
  12. 2
      src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.h
  13. 2
      src/Magnum/DebugTools/Implementation/BoxRenderer.h
  14. 2
      src/Magnum/DebugTools/Implementation/CapsuleRenderer.h
  15. 2
      src/Magnum/DebugTools/Implementation/CylinderRenderer.h
  16. 2
      src/Magnum/DebugTools/Implementation/LineSegmentRenderer.h
  17. 2
      src/Magnum/DebugTools/Implementation/PointRenderer.h
  18. 2
      src/Magnum/DebugTools/Implementation/SphereRenderer.h
  19. 88
      src/Magnum/Magnum.h
  20. 8
      src/Magnum/Math/Angle.h
  21. 6
      src/Magnum/Math/BoolVector.h
  22. 6
      src/Magnum/Math/Math.h
  23. 14
      src/Magnum/Math/Matrix.h
  24. 3
      src/Magnum/Math/Range.h
  25. 27
      src/Magnum/Math/RectangularMatrix.h
  26. 4
      src/Magnum/Math/Test/AngleTest.cpp
  27. 8
      src/Magnum/Math/Test/BoolVectorTest.cpp
  28. 10
      src/Magnum/Math/Test/Matrix3Test.cpp
  29. 10
      src/Magnum/Math/Test/Matrix4Test.cpp
  30. 10
      src/Magnum/Math/Test/MatrixTest.cpp
  31. 23
      src/Magnum/Math/Test/RangeTest.cpp
  32. 15
      src/Magnum/Math/Test/RectangularMatrixTest.cpp
  33. 15
      src/Magnum/Math/Test/Vector2Test.cpp
  34. 15
      src/Magnum/Math/Test/Vector3Test.cpp
  35. 15
      src/Magnum/Math/Test/Vector4Test.cpp
  36. 20
      src/Magnum/Math/Test/VectorTest.cpp
  37. 24
      src/Magnum/Math/Vector.h
  38. 4
      src/Magnum/MeshTools/CombineIndexedArrays.cpp
  39. 4
      src/Magnum/MeshTools/RemoveDuplicates.h
  40. 9
      src/Magnum/MeshTools/Test/TransformTest.cpp
  41. 2
      src/Magnum/Platform/Implementation/EglContextHandler.h
  42. 2
      src/Magnum/Platform/Implementation/GlxContextHandler.h
  43. 1
      src/Magnum/Platform/NaClApplication.h
  44. 1
      src/Magnum/Platform/WindowlessNaClApplication.h
  45. 4
      src/Magnum/Platform/magnum-info.cpp
  46. 4
      src/Magnum/ResourceManager.h
  47. 14
      src/Magnum/SceneGraph/AbstractCamera.h
  48. 23
      src/Magnum/SceneGraph/AbstractFeature.h
  49. 10
      src/Magnum/SceneGraph/AbstractGroupedFeature.h
  50. 10
      src/Magnum/SceneGraph/AbstractObject.h
  51. 16
      src/Magnum/SceneGraph/AbstractTransformation.h
  52. 16
      src/Magnum/SceneGraph/AbstractTranslation.h
  53. 14
      src/Magnum/SceneGraph/Animable.h
  54. 14
      src/Magnum/SceneGraph/AnimableGroup.h
  55. 7
      src/Magnum/SceneGraph/Camera2D.h
  56. 7
      src/Magnum/SceneGraph/Camera3D.h
  57. 40
      src/Magnum/SceneGraph/Drawable.h
  58. 10
      src/Magnum/SceneGraph/FeatureGroup.h
  59. 54
      src/Magnum/SceneGraph/SceneGraph.h
  60. 16
      src/Magnum/SceneGraph/TranslationTransformation.h
  61. 1
      src/Magnum/Shapes/shapeImplementation.h
  62. 1
      src/Magnum/Test/AbstractOpenGLTester.h
  63. 3
      src/Magnum/Test/AbstractQueryGLTest.cpp
  64. 3
      src/Magnum/Test/AbstractShaderProgramGLTest.cpp
  65. 3
      src/Magnum/Test/AbstractTextureGLTest.cpp
  66. 4
      src/Magnum/Test/ArrayTest.cpp
  67. 3
      src/Magnum/Test/BufferGLTest.cpp
  68. 3
      src/Magnum/Test/BufferImageGLTest.cpp
  69. 15
      src/Magnum/Test/ColorTest.cpp
  70. 3
      src/Magnum/Test/FramebufferGLTest.cpp
  71. 3
      src/Magnum/Test/ImageTest.cpp
  72. 3
      src/Magnum/Test/MeshGLTest.cpp
  73. 3
      src/Magnum/Test/RenderbufferGLTest.cpp
  74. 1
      src/Magnum/Test/ResourceManagerTest.cpp
  75. 3
      src/Magnum/Test/ShaderGLTest.cpp
  76. 3
      src/Magnum/Trade/Test/ImageDataTest.cpp
  77. 8
      src/MagnumPlugins/MagnumFont/MagnumFont.cpp
  78. 8
      src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp
  79. 8
      src/MagnumPlugins/ObjImporter/ObjImporter.cpp

4
CMakeLists.txt

@ -108,8 +108,8 @@ if(BUILD_TESTS)
endif()
# Check compiler compatibility
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.6.0")
message(FATAL_ERROR "Compatibility branch of Magnum is needed for use with GCC < 4.6. See the documentation for more information.")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.7.0")
message(FATAL_ERROR "Compatibility branch of Magnum is needed for use with GCC < 4.7. See the documentation for more information.")
elseif(MSVC)
message(FATAL_ERROR "Compatibility branch of Magnum is needed for use with MSVC. See the documentation for more information.")
endif()

6
README.md

@ -84,9 +84,9 @@ Minimal dependencies
--------------------
* C++ compiler with good C++11 support. Currently there are two compilers
which are tested to have everything needed: **GCC** >= 4.6 and **Clang**
>= 3.1. On Windows you can use **MinGW**. GCC 4.5, 4.4 and **MSVC** 2013
support involves some ugly workarounds and thus is available only in
which are tested to have everything needed: **GCC** >= 4.7 and **Clang**
>= 3.1. On Windows you can use **MinGW**. GCC 4.6, 4.5, 4.4 and **MSVC**
2013 support involves some ugly workarounds and thus is available only in
`compatibility` branch.
* **CMake** >= 2.8.8
* **Corrade** - Plugin management and utility library. You can get it at

8
doc/building.dox

@ -33,9 +33,9 @@ namespace Magnum {
Minimal set of tools and libraries required for building is:
- C++ compiler with good C++11 support. Currently there are two compilers
which are tested to have everything needed: **GCC** >= 4.6 and **Clang**
>= 3.1. On Windows you can use **MinGW**. GCC 4.5, 4.4 and **MSVC** 2013
support involves some ugly workarounds and thus is available only in
which are tested to have everything needed: **GCC** >= 4.7 and **Clang**
>= 3.1. On Windows you can use **MinGW**. GCC 4.6, 4.5, 4.4 and **MSVC**
2013 support involves some ugly workarounds and thus is available only in
`compatibility` branch.
- **CMake** >= 2.8.8
- **Corrade** - Plugin management and utility library. See
@ -493,7 +493,7 @@ or `update-job`).
Build is done using **Ninja** build system and everything possible is enabled,
thus you need also **SDL2**, **GLUT** and **OpenAL** libraries. It expects that
**GCC** >=4.8.2, 4.7, 4.6 and **Clang** are installed and there are **OpenGL**,
**GCC** >=4.8.2, 4.7 and **Clang** are installed and there are **OpenGL**,
**OpenGL ES 2.0** and **OpenGL ES 3.0** librares as it tries to compile the
library with every combination of them. You can add/remove the axes in
`axes/hudson.matrix.TextAxis` or via the web interface later.

2
doc/portability.dox

@ -70,7 +70,7 @@ for more information.
Each feature is marked accordingly if it is not available on some compilers,
see @ref SceneGraph::DrawableGroup3D for an example. It is up to you (or your
platform) which compiler your code will support, code written for e.g. GCC 4.6
platform) which compiler your code will support, code written for e.g. GCC 4.7
will work also on Magnum compiled with support for newer compilers, although
newer compilers may catch errors that weren't spotted by earlier versions.

56
package/archlinux/PKGBUILD-gcc46

@ -1,56 +0,0 @@
# Author: mosra <mosra@centrum.cz>
pkgname=magnum
pkgver=dev.gcc46
pkgrel=1
pkgdesc="C++11 and OpenGL 2D/3D graphics engine (built with GCC 4.6)"
arch=('i686' 'x86_64')
url="http://mosra.cz/blog/magnum.php"
license=('MIT')
depends=('corrade' 'openal' 'freeglut' 'sdl2')
makedepends=('cmake' 'ninja' 'gcc46')
options=('!strip' 'staticlibs')
provides=('magnum-git')
build() {
if [ ! -d "$startdir/build-gcc46" ] ; then
mkdir "$startdir/build-gcc46"
cd "$startdir/build-gcc46"
cmake .. \
-DCMAKE_CXX_COMPILER=g++-4.6 \
-G Ninja
fi
cd "$startdir/build-gcc46"
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=/usr \
-DWITH_AUDIO=ON \
-DWITH_GLUTAPPLICATION=ON \
-DWITH_GLXAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \
-DWITH_WINDOWLESSGLXAPPLICATION=ON \
-DWITH_MAGNUMFONT=ON \
-DWITH_MAGNUMFONTCONVERTER=ON \
-DWITH_OBJIMPORTER=ON \
-DWITH_TGAIMAGECONVERTER=ON \
-DWITH_TGAIMPORTER=ON \
-DWITH_WAVAUDIOIMPORTER=ON \
-DWITH_DISTANCEFIELDCONVERTER=ON \
-DWITH_FONTCONVERTER=ON \
-DWITH_MAGNUMINFO=ON \
-DBUILD_TESTS=ON \
-DBUILD_GL_TESTS=ON
ninja
}
check() {
cd "$startdir/build-gcc46"
ctest --output-on-failure -j5
}
package() {
cd "$startdir/build-gcc46"
DESTDIR="$pkgdir/" ninja install
}

1
package/ci/jenkins-gltests.xml

@ -52,7 +52,6 @@
<values>
<string>g++</string>
<string>g++-4.7</string>
<string>g++-4.6</string>
<string>clang++</string>
<string>clang++-libc++</string>
</values>

1
package/ci/jenkins.xml

@ -54,7 +54,6 @@
<values>
<string>g++</string>
<string>g++-4.7</string>
<string>g++-4.6</string>
<string>clang++</string>
<string>clang++-libc++</string>
</values>

7
src/CMakeLists.txt

@ -23,13 +23,6 @@
# DEALINGS IN THE SOFTWARE.
#
# Disable `-pedantic` for GCC 4.6, as the compiler doesn't like
# list-initialization of array of classes (RectangularMatrix constructors). It
# is perfectly legal C++11 and both GCC 4.7 and Clang accept it without notice.
if(CORRADE_GCC46_COMPATIBILITY)
string(REPLACE "-pedantic" "" CORRADE_CXX_FLAGS "${CORRADE_CXX_FLAGS}")
endif()
# On 4.8.2 strict aliasing causes failure of DebugToolsCylinderRendererTest
# without any warning, only in release build, any attempt to add debug print
# results in issue disappearing. Not an issue on Clang or GCC < 4.8.

6
src/Magnum/Array.h

@ -73,13 +73,7 @@ template<UnsignedInt dimensions, class T> class Array {
#ifdef DOXYGEN_GENERATING_OUTPUT
constexpr /*implicit*/ Array(T value);
#else
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class U, class V = typename std::enable_if<std::is_same<T, U>::value && dimensions != 1, T>::type> constexpr /*implicit*/ Array(U value): Array(typename Math::Implementation::GenerateSequence<dimensions>::Type(), value) {}
#else
template<class U, class V = typename std::enable_if<std::is_same<T, U>::value && dimensions != 1, T>::type> /*implicit*/ Array(U value) {
*this = Array(typename Math::Implementation::GenerateSequence<dimensions>::Type(), value);
}
#endif
#endif
/** @brief Equality */

4
src/Magnum/Context.cpp

@ -424,11 +424,7 @@ Context::Context() {
std::unordered_map<std::string, Extension> futureExtensions;
for(std::size_t i = future; i != versions.size(); ++i)
for(const Extension& extension: Extension::extensions(versions[i]))
#ifndef CORRADE_GCC46_COMPATIBILITY
futureExtensions.emplace(extension._string, extension);
#else
futureExtensions.insert({extension._string, extension});
#endif
/* Check for presence of future and vendor extensions */
const std::vector<std::string> extensions = extensionStrings();

9
src/Magnum/DebugTools/ForceRenderer.cpp

@ -41,23 +41,14 @@ template<UnsignedInt dimensions> ResourceKey shaderKey();
template<> inline ResourceKey shaderKey<2>() { return ResourceKey("FlatShader2D"); }
template<> inline ResourceKey shaderKey<3>() { return ResourceKey("FlatShader3D"); }
/** @bug Why this is not constexpr under GCC 4.6? */
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr std::array<Vector2, 4> positions{{
#else
const std::array<Vector2, 4> positions{{
#endif
{0.0f, 0.0f},
{1.0f, 0.0f},
{0.9f, 0.1f},
{0.9f, -0.1f}
}};
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr std::array<UnsignedByte, 6> indices{{
#else
const std::array<UnsignedByte, 6> indices{{
#endif
0, 1,
1, 2,
1, 3

2
src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.h

@ -25,8 +25,6 @@
DEALINGS IN THE SOFTWARE.
*/
#include <Corrade/compatibility.h>
#include "Magnum/Shapes/Shapes.h"
#include "AbstractBoxRenderer.h"

2
src/Magnum/DebugTools/Implementation/BoxRenderer.h

@ -25,8 +25,6 @@
DEALINGS IN THE SOFTWARE.
*/
#include <Corrade/compatibility.h>
#include "Magnum/Shapes/Shapes.h"
#include "AbstractBoxRenderer.h"

2
src/Magnum/DebugTools/Implementation/CapsuleRenderer.h

@ -25,8 +25,6 @@
DEALINGS IN THE SOFTWARE.
*/
#include <Corrade/compatibility.h>
#include "Magnum/Shapes/Shapes.h"
#include "AbstractShapeRenderer.h"

2
src/Magnum/DebugTools/Implementation/CylinderRenderer.h

@ -25,8 +25,6 @@
DEALINGS IN THE SOFTWARE.
*/
#include <Corrade/compatibility.h>
#include "Magnum/Shapes/Shapes.h"
#include "AbstractShapeRenderer.h"

2
src/Magnum/DebugTools/Implementation/LineSegmentRenderer.h

@ -25,8 +25,6 @@
DEALINGS IN THE SOFTWARE.
*/
#include <Corrade/compatibility.h>
#include "Magnum/Shapes/Shapes.h"
#include "AbstractShapeRenderer.h"

2
src/Magnum/DebugTools/Implementation/PointRenderer.h

@ -25,8 +25,6 @@
DEALINGS IN THE SOFTWARE.
*/
#include <Corrade/compatibility.h>
#include "Magnum/Shapes/Shapes.h"
#include "AbstractShapeRenderer.h"

2
src/Magnum/DebugTools/Implementation/SphereRenderer.h

@ -25,8 +25,6 @@
DEALINGS IN THE SOFTWARE.
*/
#include <Corrade/compatibility.h>
#include "Magnum/Shapes/Shapes.h"
#include "AbstractShapeRenderer.h"

88
src/Magnum/Magnum.h

@ -49,7 +49,6 @@ namespace Math {
/** @todoc Remove `ifndef` when Doxygen is able to handle operator"" */
#ifndef DOXYGEN_GENERATING_OUTPUT
#ifndef CORRADE_GCC46_COMPATIBILITY
#ifndef MAGNUM_TARGET_GLES
constexpr Rad<Double> operator "" _rad(long double);
constexpr Deg<Double> operator "" _deg(long double);
@ -57,7 +56,6 @@ namespace Math {
constexpr Rad<Float> operator "" _radf(long double);
constexpr Deg<Float> operator "" _degf(long double);
#endif
#endif
}
/* Bring whole Corrade namespace */
@ -228,11 +226,7 @@ typedef Math::Matrix3<Float> Matrix3;
typedef Math::Matrix4<Float> Matrix4;
/** @brief 2x2 float matrix */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix2x2<Float> Matrix2x2;
#else
typedef Math::Matrix<2, Float> Matrix2x2;
#endif
/**
@brief 3x3 float matrix
@ -240,11 +234,7 @@ typedef Math::Matrix<2, Float> Matrix2x2;
Note that this is different from @ref Matrix3, which contains additional
functions for transformations in 2D.
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix3x3<Float> Matrix3x3;
#else
typedef Math::Matrix<3, Float> Matrix3x3;
#endif
/**
@brief 4x4 float matrix
@ -252,53 +242,25 @@ typedef Math::Matrix<3, Float> Matrix3x3;
Note that this is different from @ref Matrix4, which contains additional
functions for transformations in 3D.
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix4x4<Float> Matrix4x4;
#else
typedef Math::Matrix<4, Float> Matrix4x4;
#endif
/** @brief Float matrix with 2 columns and 3 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix2x3<Float> Matrix2x3;
#else
typedef Math::RectangularMatrix<2, 3, Float> Matrix2x3;
#endif
/** @brief Float matrix with 3 columns and 2 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix3x2<Float> Matrix3x2;
#else
typedef Math::RectangularMatrix<3, 2, Float> Matrix3x2;
#endif
/** @brief Float matrix with 2 columns and 4 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix2x4<Float> Matrix2x4;
#else
typedef Math::RectangularMatrix<2, 4, Float> Matrix2x4;
#endif
/** @brief Float matrix with 4 columns and 2 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix4x2<Float> Matrix4x2;
#else
typedef Math::RectangularMatrix<4, 2, Float> Matrix4x2;
#endif
/** @brief Float matrix with 3 columns and 4 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix3x4<Float> Matrix3x4;
#else
typedef Math::RectangularMatrix<3, 4, Float> Matrix3x4;
#endif
/** @brief Float matrix with 4 columns and 3 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix4x3<Float> Matrix4x3;
#else
typedef Math::RectangularMatrix<4, 3, Float> Matrix4x3;
#endif
/** @brief Float complex number */
typedef Math::Complex<Float> Complex;
@ -322,11 +284,7 @@ typedef Math::Deg<Float> Deg;
typedef Math::Rad<Float> Rad;
/** @brief Float 1D range */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Range1D<Float> Range1D;
#else
typedef Math::Range<1, Float> Range1D;
#endif
/** @brief Float 2D range */
typedef Math::Range2D<Float> Range2D;
@ -335,11 +293,7 @@ typedef Math::Range2D<Float> Range2D;
typedef Math::Range3D<Float> Range3D;
/** @brief Signed integer 1D range */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Range1D<Int> Range1Di;
#else
typedef Math::Range<1, Int> Range1Di;
#endif
/** @brief Signed integer 2D range */
typedef Math::Range2D<Int> Range2Di;
@ -397,11 +351,7 @@ typedef Math::Matrix3<Double> Matrix3d;
typedef Math::Matrix4<Double> Matrix4d;
/** @brief 2x2 double matrix */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix2x2<Double> Matrix2x2d;
#else
typedef Math::Matrix<2, Double> Matrix2x2d;
#endif
/**
@brief 3x3 double matrix
@ -409,11 +359,7 @@ typedef Math::Matrix<2, Double> Matrix2x2d;
Note that this is different from @ref Matrix3d, which contains additional
functions for transformations in 2D.
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix3x3<Double> Matrix3x3d;
#else
typedef Math::Matrix<3, Double> Matrix3x3d;
#endif
/**
@brief 4x4 double matrix
@ -421,53 +367,25 @@ typedef Math::Matrix<3, Double> Matrix3x3d;
Note that this is different from @ref Matrix4d, which contains additional
functions for transformations in 3D.
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix4x4<Double> Matrix4x4d;
#else
typedef Math::Matrix<4, Double> Matrix4x4d;
#endif
/** @brief Double matrix with 2 columns and 3 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix2x3<Double> Matrix2x3d;
#else
typedef Math::RectangularMatrix<2, 3, Double> Matrix2x3d;
#endif
/** @brief Double matrix with 3 columns and 2 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix3x2<Double> Matrix3x2d;
#else
typedef Math::RectangularMatrix<3, 2, Double> Matrix3x2d;
#endif
/** @brief Double matrix with 2 columns and 4 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix2x4<Double> Matrix2x4d;
#else
typedef Math::RectangularMatrix<2, 4, Double> Matrix2x4d;
#endif
/** @brief Double matrix with 4 columns and 2 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix4x2<Double> Matrix4x2d;
#else
typedef Math::RectangularMatrix<4, 2, Double> Matrix4x2d;
#endif
/** @brief Double matrix with 3 columns and 4 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix3x4<Double> Matrix3x4d;
#else
typedef Math::RectangularMatrix<3, 4, Double> Matrix3x4d;
#endif
/** @brief Double matrix with 4 columns and 3 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix4x3<Double> Matrix4x3d;
#else
typedef Math::RectangularMatrix<4, 3, Double> Matrix4x3d;
#endif
/** @brief Double complex number */
typedef Math::Complex<Double> Complexd;
@ -491,11 +409,7 @@ typedef Math::Deg<Double> Degd;
typedef Math::Rad<Double> Radd;
/** @brief Double 1D range */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Range1D<Double> Range1Dd;
#else
typedef Math::Range<1, Double> Range1Dd;
#endif
/** @brief Double 2D range */
typedef Math::Range2D<Double> Range2Dd;
@ -514,7 +428,6 @@ typedef CORRADE_DEPRECATED("use Range2Dd instead") Math::Geometry::Rectangle<Dou
/*@}*/
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/* Using angle literals from Math namespace */
#ifndef MAGNUM_TARGET_GLES
using Math::operator "" _deg;
@ -522,7 +435,6 @@ using Math::operator "" _rad;
#endif
using Math::operator "" _degf;
using Math::operator "" _radf;
#endif
/* Forward declarations for all types in root namespace */

8
src/Magnum/Math/Angle.h

@ -146,7 +146,6 @@ template<class T> class Deg: public Unit<Deg, T> {
constexpr /*implicit*/ Deg(Unit<Rad, T> value);
};
#ifndef CORRADE_GCC46_COMPATIBILITY
#ifndef MAGNUM_TARGET_GLES
/** @relates Deg
@brief Double-precision degree value literal
@ -157,7 +156,6 @@ Double cosine = Math::cos(60.0_deg); // cosine = 0.5
Double cosine = Math::cos(1.047_rad); // cosine = 0.5
@endcode
@see Magnum::operator""_deg(), operator""_degf(), operator""_rad()
@note Not available on GCC < 4.7. Use @ref Deg::Deg(T) instead.
@requires_gl Only single-precision types are available in OpenGL ES.
@todoc Make references explicit when Doxygen can link to operator""
*/
@ -173,12 +171,10 @@ Float tangent = Math::tan(60.0_degf); // tangent = 1.732f
Float tangent = Math::tan(1.047_radf); // tangent = 1.732f
@endcode
@see Magnum::operator""_degf(), operator""_deg(), operator""_radf()
@note Not available on GCC < 4.7. Use @ref Deg::Deg(T) instead.
@requires_gl Only single-precision types are available in OpenGL ES.
@todoc Make references explicit when Doxygen can link to operator""
*/
constexpr Deg<Float> operator "" _degf(long double value) { return Deg<Float>(value); }
#endif
/**
@brief Angle in radians
@ -211,14 +207,12 @@ template<class T> class Rad: public Unit<Rad, T> {
constexpr /*implicit*/ Rad(Unit<Deg, T> value);
};
#ifndef CORRADE_GCC46_COMPATIBILITY
#ifndef MAGNUM_TARGET_GLES
/** @relates Rad
@brief Double-precision radian value literal
See operator""_rad() for more information.
@see Magnum::operator""_rad(), operator""_radf(), operator""_deg()
@note Not available on GCC < 4.7. Use @ref Rad::Rad(T) instead.
@todoc Make references explicit when Doxygen can link to operator""
*/
constexpr Rad<Double> operator "" _rad(long double value) { return Rad<Double>(value); }
@ -229,11 +223,9 @@ constexpr Rad<Double> operator "" _rad(long double value) { return Rad<Double>(v
See operator""_degf() for more information.
@see Magnum::operator""_radf(), operator""_rad(), operator""_degf()
@note Not available on GCC < 4.7. Use @ref Rad::Rad(T) instead.
@todoc Make references explicit when Doxygen can link to operator""
*/
constexpr Rad<Float> operator "" _radf(long double value) { return Rad<Float>(value); }
#endif
template<class T> constexpr Deg<T>::Deg(Unit<Rad, T> value): Unit<Math::Deg, T>(T(180)*T(value)/Math::Constants<T>::pi()) {}
template<class T> constexpr Rad<T>::Rad(Unit<Deg, T> value): Unit<Math::Rad, T>(T(value)*Math::Constants<T>::pi()/T(180)) {}

6
src/Magnum/Math/BoolVector.h

@ -87,13 +87,7 @@ template<std::size_t size> class BoolVector {
#ifdef DOXYGEN_GENERATING_OUTPUT
inline explicit BoolVector(T value);
#else
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T, class U = typename std::enable_if<std::is_same<bool, T>::value && size != 1, bool>::type> constexpr explicit BoolVector(T value): BoolVector(typename Implementation::GenerateSequence<DataSize>::Type(), value ? FullSegmentMask : 0) {}
#else
template<class T, class U = typename std::enable_if<std::is_same<bool, T>::value && size != 1, bool>::type> explicit BoolVector(T value) {
*this = BoolVector(typename Implementation::GenerateSequence<DataSize>::Type(), value ? FullSegmentMask : 0);
}
#endif
#endif
/** @brief Copy constructor */

6
src/Magnum/Math/Math.h

@ -46,11 +46,9 @@ template<class> class DualComplex;
template<class> class DualQuaternion;
template<std::size_t, class> class Matrix;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T> using Matrix2x2 = Matrix<2, T>;
template<class T> using Matrix3x3 = Matrix<3, T>;
template<class T> using Matrix4x4 = Matrix<4, T>;
#endif
template<class> class Matrix3;
template<class> class Matrix4;
@ -58,14 +56,12 @@ template<class> class Matrix4;
template<class> class Quaternion;
template<std::size_t, std::size_t, class> class RectangularMatrix;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T> using Matrix2x3 = RectangularMatrix<2, 3, T>;
template<class T> using Matrix3x2 = RectangularMatrix<3, 2, T>;
template<class T> using Matrix2x4 = RectangularMatrix<2, 4, T>;
template<class T> using Matrix4x2 = RectangularMatrix<4, 2, T>;
template<class T> using Matrix3x4 = RectangularMatrix<3, 4, T>;
template<class T> using Matrix4x3 = RectangularMatrix<4, 3, T>;
#endif
template<template<class> class, class> class Unit;
template<class> class Deg;
@ -77,9 +73,7 @@ template<class> class Vector3;
template<class> class Vector4;
template<UnsignedInt, class> class Range;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T> using Range1D = Range<1, T>;
#endif
template<class> class Range2D;
template<class> class Range3D;

14
src/Magnum/Math/Matrix.h

@ -71,14 +71,7 @@ template<std::size_t size, class T> class Matrix: public RectangularMatrix<size,
* `%Matrix m(Matrix::Identity);`. Optional parameter @p value allows
* you to specify value on diagonal.
*/
constexpr /*implicit*/ Matrix(IdentityType = Identity, T value = T(1)): RectangularMatrix<size, size, T>(typename Implementation::GenerateSequence<size>::Type(),
/* The original one is not constexpr under GCC 4.6 */
#ifndef CORRADE_GCC46_COMPATIBILITY
Vector<size, T>(value)
#else
Vector<size, T>(typename Implementation::GenerateSequence<size>::Type(), value)
#endif
) {}
constexpr /*implicit*/ Matrix(IdentityType = Identity, T value = T(1)): RectangularMatrix<size, size, T>(typename Implementation::GenerateSequence<size>::Type(), Vector<size, T>(value)) {}
/**
* @brief %Matrix from column vectors
@ -188,13 +181,11 @@ template<std::size_t size, class T> class Matrix: public RectangularMatrix<size,
#endif
};
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief 2x2 matrix
Convenience alternative to <tt>%Matrix<2, T></tt>. See @ref Matrix for more
information.
@note Not available on GCC < 4.7. Use <tt>%Matrix<2, T></tt> instead.
@see @ref Magnum::Matrix2x2, @ref Magnum::Matrix2x2d
*/
template<class T> using Matrix2x2 = Matrix<2, T>;
@ -205,7 +196,6 @@ template<class T> using Matrix2x2 = Matrix<2, T>;
Convenience alternative to <tt>%Matrix<3, T></tt>. See @ref Matrix for more
information. Note that this is different from @ref Matrix3, which contains
additional functions for transformations in 2D.
@note Not available on GCC < 4.7. Use <tt>%Matrix<3, T></tt> instead.
@see @ref Magnum::Matrix3x3, @ref Magnum::Matrix3x3d
*/
template<class T> using Matrix3x3 = Matrix<3, T>;
@ -216,11 +206,9 @@ template<class T> using Matrix3x3 = Matrix<3, T>;
Convenience alternative to <tt>%Matrix<4, T></tt>. See @ref Matrix for more
information. Note that this is different from @ref Matrix4, which contains
additional functions for transformations in 3D.
@note Not available on GCC < 4.7. Use <tt>%Matrix<3, T></tt> instead.
@see @ref Magnum::Matrix4x4, @ref Magnum::Matrix4x4d
*/
template<class T> using Matrix4x4 = Matrix<4, T>;
#endif
MAGNUM_MATRIX_OPERATOR_IMPLEMENTATION(Matrix<size, T>)

3
src/Magnum/Math/Range.h

@ -185,16 +185,13 @@ template<UnsignedInt dimensions, class T> class Range {
}
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief One-dimensional range
Convenience alternative to <tt>%Range<1, T></tt>. See @ref Range for more
information.
@note Not available on GCC < 4.7. Use <tt>%Range<1, T></tt> instead.
*/
template<class T> using Range1D = Range<1, T>;
#endif
/**
@brief Two-dimensional range

27
src/Magnum/Math/RectangularMatrix.h

@ -130,22 +130,10 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
* // integral == {1, 2, -15, 7}
* @endcode
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class U> constexpr explicit RectangularMatrix(const RectangularMatrix<cols, rows, U>& other): RectangularMatrix(typename Implementation::GenerateSequence<cols>::Type(), other) {}
#else
template<class U> explicit RectangularMatrix(const RectangularMatrix<cols, rows, U>& other) {
*this = RectangularMatrix(typename Implementation::GenerateSequence<cols>::Type(), other);
}
#endif
/** @brief Construct matrix from external representation */
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class U, class V = decltype(Implementation::RectangularMatrixConverter<cols, rows, T, U>::from(std::declval<U>()))> constexpr explicit RectangularMatrix(const U& other): RectangularMatrix(Implementation::RectangularMatrixConverter<cols, rows, T, U>::from(other)) {}
#else
template<class U, class V = decltype(Implementation::RectangularMatrixConverter<cols, rows, T, U>::from(std::declval<U>()))> explicit RectangularMatrix(const U& other) {
*this = Implementation::RectangularMatrixConverter<cols, rows, T, U>::from(other);
}
#endif
/** @brief Copy constructor */
constexpr RectangularMatrix(const RectangularMatrix<cols, rows, T>&) = default;
@ -155,7 +143,6 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
/** @brief Convert matrix to external representation */
template<class U, class V = decltype(Implementation::RectangularMatrixConverter<cols, rows, T, U>::to(std::declval<RectangularMatrix<cols, rows, T>>()))> constexpr explicit operator U() const {
/** @bug Why this is not constexpr under GCC 4.6? */
return Implementation::RectangularMatrixConverter<cols, rows, T, U>::to(*this);
}
@ -379,14 +366,11 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
Vector<rows, T> _data[cols];
};
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief %Matrix with 2 columns and 3 rows
Convenience alternative to <tt>%RectangularMatrix<2, 3, T></tt>. See
@ref RectangularMatrix for more information.
@note Not available on GCC < 4.7. Use <tt>%RectangularMatrix<2, 3, T></tt>
instead.
@see @ref Magnum::Matrix2x3, @ref Magnum::Matrix2x3d
*/
template<class T> using Matrix2x3 = RectangularMatrix<2, 3, T>;
@ -396,8 +380,6 @@ template<class T> using Matrix2x3 = RectangularMatrix<2, 3, T>;
Convenience alternative to <tt>%RectangularMatrix<3, 2, T></tt>. See
@ref RectangularMatrix for more information.
@note Not available on GCC < 4.7. Use <tt>%RectangularMatrix<3, 2, T></tt>
instead.
@see @ref Magnum::Matrix3x2, @ref Magnum::Matrix3x2d
*/
template<class T> using Matrix3x2 = RectangularMatrix<3, 2, T>;
@ -407,8 +389,6 @@ template<class T> using Matrix3x2 = RectangularMatrix<3, 2, T>;
Convenience alternative to <tt>%RectangularMatrix<2, 4, T></tt>. See
@ref RectangularMatrix for more information.
@note Not available on GCC < 4.7. Use <tt>%RectangularMatrix<2, 4, T></tt>
instead.
@see @ref Magnum::Matrix2x4, @ref Magnum::Matrix2x4d
*/
template<class T> using Matrix2x4 = RectangularMatrix<2, 4, T>;
@ -418,8 +398,6 @@ template<class T> using Matrix2x4 = RectangularMatrix<2, 4, T>;
Convenience alternative to <tt>%RectangularMatrix<4, 2, T></tt>. See
@ref RectangularMatrix for more information.
@note Not available on GCC < 4.7. Use <tt>%RectangularMatrix<4, 2, T></tt>
instead.
@see @ref Magnum::Matrix4x2, @ref Magnum::Matrix4x2d
*/
template<class T> using Matrix4x2 = RectangularMatrix<4, 2, T>;
@ -429,8 +407,6 @@ template<class T> using Matrix4x2 = RectangularMatrix<4, 2, T>;
Convenience alternative to <tt>%RectangularMatrix<3, 4, T></tt>. See
@ref RectangularMatrix for more information.
@note Not available on GCC < 4.7. Use <tt>%RectangularMatrix<3, 4, T></tt>
instead.
@see @ref Magnum::Matrix3x4, @ref Magnum::Matrix3x4d
*/
template<class T> using Matrix3x4 = RectangularMatrix<3, 4, T>;
@ -440,12 +416,9 @@ template<class T> using Matrix3x4 = RectangularMatrix<3, 4, T>;
Convenience alternative to <tt>%RectangularMatrix<4, 3, T></tt>. See
@ref RectangularMatrix for more information.
@note Not available on GCC < 4.7. Use <tt>%RectangularMatrix<4, 3, T></tt>
instead.
@see @ref Magnum::Matrix4x3, @ref Magnum::Matrix4x3d
*/
template<class T> using Matrix4x3 = RectangularMatrix<4, 3, T>;
#endif
/** @relates RectangularMatrix
@brief Multiply number with matrix

4
src/Magnum/Math/Test/AngleTest.cpp

@ -105,7 +105,6 @@ void AngleTest::construct() {
}
void AngleTest::literals() {
#ifndef CORRADE_GCC46_COMPATIBILITY
#ifndef MAGNUM_TARGET_GLES
constexpr auto a = 25.0_deg;
CORRADE_VERIFY((std::is_same<decltype(a), const Degd>::value));
@ -123,9 +122,6 @@ void AngleTest::literals() {
constexpr auto n = 3.14_radf;
CORRADE_VERIFY((std::is_same<decltype(n), const Rad>::value));
CORRADE_COMPARE(Float(n), 3.14f);
#else
CORRADE_SKIP("User-defined literals are not available on GCC < 4.7.");
#endif
}
void AngleTest::conversion() {

8
src/Magnum/Math/Test/BoolVectorTest.cpp

@ -90,18 +90,10 @@ void BoolVectorTest::constructDefault() {
}
void BoolVectorTest::constructOneValue() {
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr BoolVector19 a(false);
#else
BoolVector19 a(false); /* not constexpr under GCC < 4.7 */
#endif
CORRADE_COMPARE(a, BoolVector19(0x00, 0x00, 0x00));
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr BoolVector19 b(true);
#else
BoolVector19 b(true); /* not constexpr under GCC < 4.7 */
#endif
CORRADE_COMPARE(b, BoolVector19(0xff, 0xff, 0x07));
CORRADE_VERIFY(!(std::is_convertible<bool, BoolVector19>::value));

10
src/Magnum/Math/Test/Matrix3Test.cpp

@ -162,10 +162,7 @@ void Matrix3Test::constructConversion() {
constexpr Matrix3 a({3.0f, 5.0f, 8.0f},
{4.5f, 4.0f, 7.0f},
{7.9f, -1.0f, 8.0f});
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Matrix3i b(a);
constexpr Matrix3i b(a);
CORRADE_COMPARE(b, Matrix3i({3, 5, 8},
{4, 4, 7},
{7, -1, 8}));
@ -195,10 +192,7 @@ void Matrix3Test::convert() {
constexpr Matrix3 c(b);
CORRADE_COMPARE(c, b);
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Mat3 d(b);
constexpr Mat3 d(b);
for(std::size_t i = 0; i != 9; ++i)
CORRADE_COMPARE(d.a[0], a.a[0]);

10
src/Magnum/Math/Test/Matrix4Test.cpp

@ -181,10 +181,7 @@ void Matrix4Test::constructConversion() {
{4.5f, 4.0f, 7.0f, 2.0f},
{1.0f, 2.0f, 3.0f, -1.0f},
{7.9f, -1.0f, 8.0f, -1.5f});
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Matrix4i b(a);
constexpr Matrix4i b(a);
CORRADE_COMPARE(b, Matrix4i({3, 5, 8, -3},
{4, 4, 7, 2},
{1, 2, 3, -1},
@ -219,10 +216,7 @@ void Matrix4Test::convert() {
constexpr Matrix4 c(b);
CORRADE_COMPARE(c, b);
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Mat4 d(b);
constexpr Mat4 d(b);
for(std::size_t i = 0; i != 16; ++i)
CORRADE_COMPARE(d.a[i], a.a[i]);

10
src/Magnum/Math/Test/MatrixTest.cpp

@ -159,10 +159,7 @@ void MatrixTest::constructConversion() {
Vector4(4.5f, 4.0f, 7.0f, 2.0f),
Vector4(1.0f, 2.0f, 3.0f, -1.0f),
Vector4(7.9f, -1.0f, 8.0f, -1.5f));
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Matrix4x4i b(a);
constexpr Matrix4x4i b(a);
CORRADE_COMPARE(b, Matrix4x4i(Vector4i(3, 5, 8, -3),
Vector4i(4, 4, 7, 2),
Vector4i(1, 2, 3, -1),
@ -195,10 +192,7 @@ void MatrixTest::convert() {
constexpr Matrix3x3 c(b);
CORRADE_COMPARE(c, b);
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Mat3 d(b);
constexpr Mat3 d(b);
for(std::size_t i = 0; i != 9; ++i)
CORRADE_COMPARE(d.a[i], a.a[i]);

23
src/Magnum/Math/Test/RangeTest.cpp

@ -65,18 +65,10 @@ class RangeTest: public Corrade::TestSuite::Tester {
void configuration();
};
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Range1D<Float> Range1D;
#else
typedef Math::Range<1, Float> Range1D;
#endif
typedef Math::Range2D<Float> Range2D;
typedef Math::Range3D<Float> Range3D;
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Range1D<Int> Range1Di;
#else
typedef Math::Range<1, Int> Range1Di;
#endif
typedef Math::Range2D<Int> Range2Di;
typedef Math::Range3D<Int> Range3Di;
typedef Vector2<Int> Vector2i;
@ -140,22 +132,13 @@ void RangeTest::constructConversion() {
constexpr Range2D b({1.3f, 2.7f}, {-15.0f, 7.0f});
constexpr Range3D c({1.3f, 2.7f, -1.5f}, {-15.0f, 7.0f, 0.3f});
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Range1Di d(a);
constexpr Range1Di d(a);
CORRADE_COMPARE(d, Range1Di(1, -15));
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Range2Di e(b);
constexpr Range2Di e(b);
CORRADE_COMPARE(e, Range2Di({1, 2}, {-15, 7}));
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Range3Di f(c);
constexpr Range3Di f(c);
CORRADE_COMPARE(f, Range3Di({1, 2, -1}, {-15, 7, 0}));
/* Implicit conversion is not allowed */

15
src/Magnum/Math/Test/RectangularMatrixTest.cpp

@ -155,10 +155,7 @@ void RectangularMatrixTest::constructDefault() {
void RectangularMatrixTest::constructConversion() {
constexpr Matrix2x2 a(Vector2( 1.3f, 2.7f),
Vector2(-15.0f, 7.0f));
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Matrix2x2i b(a);
constexpr Matrix2x2i b(a);
CORRADE_COMPARE(b, Matrix2x2i(Vector2i( 1, 2),
Vector2i(-15, 7)));
@ -215,16 +212,10 @@ void RectangularMatrixTest::convert() {
constexpr Matrix2x3 b(Vector3(1.5f, 2.0f, -3.5f),
Vector3(2.0f, -3.1f, 0.4f));
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Matrix2x3 c(b);
constexpr Matrix2x3 c(b);
CORRADE_COMPARE(c, b);
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Mat2x3 d(b);
constexpr Mat2x3 d(b);
for(std::size_t i = 0; i != 5; ++i)
CORRADE_COMPARE(d.a[i], a.a[i]);

15
src/Magnum/Math/Test/Vector2Test.cpp

@ -113,10 +113,7 @@ void Vector2Test::constructDefault() {
}
void Vector2Test::constructOneValue() {
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector2 a(3.0f);
constexpr Vector2 a(3.0f);
CORRADE_COMPARE(a, Vector2(3.0f, 3.0f));
/* Implicit conversion is not allowed */
@ -125,10 +122,7 @@ void Vector2Test::constructOneValue() {
void Vector2Test::constructConversion() {
constexpr Vector2 a(1.5f, 2.5f);
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector2i b(a);
constexpr Vector2i b(a);
CORRADE_COMPARE(b, Vector2i(1, 2));
/* Implicit conversion is not allowed */
@ -148,10 +142,7 @@ void Vector2Test::convert() {
constexpr Vector2 c(a);
CORRADE_COMPARE(c, b);
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vec2 d(b);
constexpr Vec2 d(b);
CORRADE_COMPARE(d.x, a.x);
CORRADE_COMPARE(d.y, a.y);

15
src/Magnum/Math/Test/Vector3Test.cpp

@ -111,10 +111,7 @@ void Vector3Test::constructDefault() {
}
void Vector3Test::constructOneValue() {
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector3 a(-3.0f);
constexpr Vector3 a(-3.0f);
CORRADE_COMPARE(a, Vector3(-3.0f, -3.0f, -3.0f));
/* Implicit conversion is not allowed */
@ -129,10 +126,7 @@ void Vector3Test::constructParts() {
void Vector3Test::constructConversion() {
constexpr Vector3 a(1.0f, 2.5f, -3.0f);
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector3i b(a);
constexpr Vector3i b(a);
CORRADE_COMPARE(b, Vector3i(1, 2, -3));
/* Implicit conversion is not allowed */
@ -152,10 +146,7 @@ void Vector3Test::convert() {
constexpr Vector3 c(a);
CORRADE_COMPARE(c, b);
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vec3 d(b);
constexpr Vec3 d(b);
CORRADE_COMPARE(d.x, a.x);
CORRADE_COMPARE(d.y, a.y);
CORRADE_COMPARE(d.z, a.z);

15
src/Magnum/Math/Test/Vector4Test.cpp

@ -108,10 +108,7 @@ void Vector4Test::constructDefault() {
}
void Vector4Test::constructOneValue() {
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector4 a(4.3f);
constexpr Vector4 a(4.3f);
CORRADE_COMPARE(a, Vector4(4.3f, 4.3f, 4.3f, 4.3f));
/* Implicit conversion is not allowed */
@ -126,10 +123,7 @@ void Vector4Test::constructParts() {
void Vector4Test::constructConversion() {
constexpr Vector4 a(1.0f, -2.5f, 3.0f, 4.1f);
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector4i b(a);
constexpr Vector4i b(a);
CORRADE_COMPARE(b, Vector4i(1, -2, 3, 4));
/* Implicit conversion is not allowed */
@ -149,10 +143,7 @@ void Vector4Test::convert() {
constexpr Vector4 c(a);
CORRADE_COMPARE(c, b);
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vec4 d(b);
constexpr Vec4 d(b);
CORRADE_COMPARE(d.x, a.x);
CORRADE_COMPARE(d.y, a.y);
CORRADE_COMPARE(d.z, a.z);

20
src/Magnum/Math/Test/VectorTest.cpp

@ -175,10 +175,7 @@ void VectorTest::constructDefault() {
}
void VectorTest::constructOneValue() {
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector4 a(7.25f);
constexpr Vector4 a(7.25f);
CORRADE_COMPARE(a, Vector4(7.25f, 7.25f, 7.25f, 7.25f));
@ -196,10 +193,7 @@ void VectorTest::constructOneComponent() {
void VectorTest::constructConversion() {
constexpr Vector4 a(1.3f, 2.7f, -15.0f, 7.0f);
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector4i b(a);
constexpr Vector4i b(a);
CORRADE_COMPARE(b, Vector4i(1, 2, -15, 7));
@ -227,16 +221,10 @@ void VectorTest::convert() {
constexpr Vec3 a{1.5f, 2.0f, -3.5f};
constexpr Vector3 b(1.5f, 2.0f, -3.5f);
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector3 c(b);
constexpr Vector3 c(b);
CORRADE_COMPARE(c, b);
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vec3 d(b);
constexpr Vec3 d(b);
CORRADE_COMPARE(d.x, a.x);
CORRADE_COMPARE(d.y, a.y);
CORRADE_COMPARE(d.z, a.z);

24
src/Magnum/Math/Vector.h

@ -59,11 +59,6 @@ template<std::size_t size, class T> class Vector {
template<std::size_t, class> friend class Vector;
#ifdef CORRADE_GCC46_COMPATIBILITY
/* So it can call internal constexpr constructor from one value */
template<std::size_t, class> friend class Matrix;
#endif
public:
typedef T Type; /**< @brief Underlying data type */
const static std::size_t Size = size; /**< @brief %Vector size */
@ -137,13 +132,7 @@ template<std::size_t size, class T> class Vector {
#ifdef DOXYGEN_GENERATING_OUTPUT
constexpr explicit Vector(T value);
#else
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class U, class V = typename std::enable_if<std::is_same<T, U>::value && size != 1, T>::type> constexpr explicit Vector(U value): Vector(typename Implementation::GenerateSequence<size>::Type(), value) {}
#else
template<class U, class V = typename std::enable_if<std::is_same<T, U>::value && size != 1, T>::type> explicit Vector(U value) {
*this = Vector(typename Implementation::GenerateSequence<size>::Type(), value);
}
#endif
#endif
/**
@ -157,22 +146,10 @@ template<std::size_t size, class T> class Vector {
* // integral == {1, 2, -15, 7}
* @endcode
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class U> constexpr explicit Vector(const Vector<size, U>& other): Vector(typename Implementation::GenerateSequence<size>::Type(), other) {}
#else
template<class U> explicit Vector(const Vector<size, U>& other) {
*this = Vector(typename Implementation::GenerateSequence<size>::Type(), other);
}
#endif
/** @brief Construct vector from external representation */
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class U, class V = decltype(Implementation::VectorConverter<size, T, U>::from(std::declval<U>()))> constexpr explicit Vector(const U& other): Vector(Implementation::VectorConverter<size, T, U>::from(other)) {}
#else
template<class U, class V = decltype(Implementation::VectorConverter<size, T, U>::from(std::declval<U>()))> explicit Vector(const U& other) {
*this = Implementation::VectorConverter<size, T, U>::from(other);
}
#endif
/** @brief Copy constructor */
constexpr Vector(const Vector<size, T>&) = default;
@ -182,7 +159,6 @@ template<std::size_t size, class T> class Vector {
/** @brief Convert vector to external representation */
template<class U, class V = decltype(Implementation::VectorConverter<size, T, U>::to(std::declval<Vector<size, T>>()))> constexpr explicit operator U() const {
/** @bug Why this is not constexpr under GCC 4.6? */
return Implementation::VectorConverter<size, T, U>::to(*this);
}

4
src/Magnum/MeshTools/CombineIndexedArrays.cpp

@ -136,11 +136,7 @@ std::pair<std::vector<UnsignedInt>, std::vector<UnsignedInt>> combineIndexArrays
std::vector<UnsignedInt> newInterleavedArrays;
for(std::size_t oldIndex = 0, end = interleavedArrays.size()/stride; oldIndex != end; ++oldIndex) {
/* Try to insert new index combination to the map */
#ifndef CORRADE_GCC46_COMPATIBILITY
const auto result = indexCombinations.emplace(oldIndex, indexCombinations.size());
#else
const auto result = indexCombinations.insert({oldIndex, indexCombinations.size()});
#endif
/* Add the (either new or already existing) index to resulting index array */
combinedIndices.push_back(result.first->second);

4
src/Magnum/MeshTools/RemoveDuplicates.h

@ -131,11 +131,7 @@ template<class Vector> std::vector<UnsignedInt> removeDuplicates(std::vector<Vec
for(std::size_t i = 0; i != data.size(); ++i) {
/* Try to insert new vertex to the table */
const Math::Vector<Vector::Size, std::size_t> v((data[i] + moved - min)/epsilon);
#ifndef CORRADE_GCC46_COMPATIBILITY
const auto result = table.emplace(v, table.size());
#else
const auto result = table.insert({v, table.size()});
#endif
/* Add the (either new or already existing) index to index array */
indices.push_back(result.first->second);

9
src/Magnum/MeshTools/Test/TransformTest.cpp

@ -51,11 +51,6 @@ TransformTest::TransformTest() {
&TransformTest::transformPoints3D});
}
/* GCC < 4.7 doesn't like constexpr here, don't know why */
#ifdef CORRADE_GCC46_COMPATIBILITY
#define constexpr const
#endif
constexpr static std::array<Vector2, 2> points2D{{
{-3.0f, 4.0f},
{ 2.5f, -15.0f}
@ -86,10 +81,6 @@ constexpr static std::array<Vector3, 2> points3DRotatedTranslated{{
{15.0f, 1.5f, 1.5f}
}};
#ifdef CORRADE_GCC46_COMPATIBILITY
#undef constexpr
#endif
void TransformTest::transformVectors2D() {
auto matrix = MeshTools::transformVectors(Matrix3::rotation(Deg(90.0f)), points2D);
auto complex = MeshTools::transformVectors(Complex::rotation(Deg(90.0f)), points2D);

2
src/Magnum/Platform/Implementation/EglContextHandler.h

@ -33,8 +33,6 @@
#undef None
#undef Complex
#include <Corrade/compatibility.h>
#include "Magnum/Magnum.h"
#include "Magnum/Platform/AbstractXApplication.h"
#include "Magnum/Platform/Implementation/AbstractContextHandler.h"

2
src/Magnum/Platform/Implementation/GlxContextHandler.h

@ -35,8 +35,6 @@
#undef None
#undef Status
#include <Corrade/compatibility.h>
#include "Magnum/Platform/AbstractXApplication.h"
#include "Magnum/Platform/Implementation/AbstractContextHandler.h"

1
src/Magnum/Platform/NaClApplication.h

@ -30,7 +30,6 @@
*/
#include <string>
#include <Corrade/compatibility.h>
#include <Corrade/Containers/EnumSet.h>
#include <ppapi/cpp/input_event.h>
#include <ppapi/cpp/instance.h>

1
src/Magnum/Platform/WindowlessNaClApplication.h

@ -30,7 +30,6 @@
*/
#include <string>
#include <Corrade/compatibility.h>
#include <Corrade/Containers/EnumSet.h>
#include <ppapi/cpp/instance.h>
#include <ppapi/cpp/module.h>

4
src/Magnum/Platform/magnum-info.cpp

@ -25,7 +25,6 @@
#include <Corrade/Utility/Arguments.h>
#include <Corrade/Utility/Debug.h>
#include <Corrade/compatibility.h>
#ifdef CORRADE_TARGET_NACL
#include <Corrade/Utility/NaClStreamBuffer.h>
#endif
@ -105,9 +104,6 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
Debug() << "Used application: Platform::WindowlessGlxApplication";
#endif
Debug() << "Compilation flags:";
#ifdef CORRADE_GCC46_COMPATIBILITY
Debug() << " CORRADE_GCC46_COMPATIBILITY";
#endif
#ifdef CORRADE_GCC47_COMPATIBILITY
Debug() << " CORRADE_GCC47_COMPATIBILITY";
#endif

4
src/Magnum/ResourceManager.h

@ -528,11 +528,7 @@ template<class T> void ResourceManagerData<T>::set(const ResourceKey key, T* con
/* Insert it, if not already here */
} else if(it == _data.end())
#ifndef CORRADE_GCC46_COMPATIBILITY
it = _data.emplace(key, Data()).first;
#else
it = _data.insert({key, Data()}).first;
#endif
/* Replace previous data */
safeDelete(it->second.data);

14
src/Magnum/SceneGraph/AbstractCamera.h

@ -163,51 +163,37 @@ template<UnsignedInt dimensions, class T> class AbstractCamera: public AbstractF
Vector2i _viewport;
};
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief Base camera for two-dimensional scenes
Convenience alternative to <tt>%AbstractCamera<2, T></tt>. See
@ref AbstractCamera for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractCamera<2, T></tt> instead.
@see @ref AbstractCamera2D, @ref AbstractBasicCamera3D
*/
template<class T> using AbstractBasicCamera2D = AbstractCamera<2, T>;
#endif
/**
@brief Base camera for two-dimensional float scenes
@see @ref AbstractCamera3D
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef AbstractBasicCamera2D<Float> AbstractCamera2D;
#else
typedef AbstractCamera<2, Float> AbstractCamera2D;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief Base camera for three-dimensional scenes
Convenience alternative to <tt>%AbstractCamera<3, T></tt>. See
@ref AbstractCamera for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractCamera<3, T></tt> instead.
@see @ref AbstractCamera3D, @ref AbstractBasicCamera2D
*/
template<class T> using AbstractBasicCamera3D = AbstractCamera<3, T>;
#endif
/**
@brief Base camera for three-dimensional float scenes
@see @ref AbstractCamera2D
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef AbstractBasicCamera3D<Float> AbstractCamera3D;
#else
typedef AbstractCamera<3, Float> AbstractCamera3D;
#endif
#ifdef CORRADE_TARGET_WINDOWS
extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractCamera<2, Float>;

23
src/Magnum/SceneGraph/AbstractFeature.h

@ -183,14 +183,7 @@ template<UnsignedInt dimensions, class T> class AbstractFeature
/* This is here to avoid ambiguity with deleted copy constructor when
passing `*this` from class subclassing both AbstractFeature and
AbstractObject */
template<class U, class = typename std::enable_if<std::is_base_of<AbstractObject<dimensions, T>, U>::value>::type> AbstractFeature(U& object)
#ifndef CORRADE_GCC46_COMPATIBILITY
: AbstractFeature(static_cast<AbstractObject<dimensions, T>&>(object)) {}
#else
{
object.Containers::template LinkedList<AbstractFeature<dimensions, T>>::insert(this);
}
#endif
template<class U, class = typename std::enable_if<std::is_base_of<AbstractObject<dimensions, T>, U>::value>::type> AbstractFeature(U& object): AbstractFeature(static_cast<AbstractObject<dimensions, T>&>(object)) {}
#endif
virtual ~AbstractFeature() = 0;
@ -298,51 +291,37 @@ template<UnsignedInt dimensions, class T> class AbstractFeature
CachedTransformations _cachedTransformations;
};
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief Base feature for two-dimensional scenes
Convenience alternative to <tt>%AbstractFeature<2, T></tt>. See
@ref AbstractFeature for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractFeature<2, T></tt> instead.
@see @ref AbstractFeature2D, @ref AbstractBasicFeature3D
*/
template<class T> using AbstractBasicFeature2D = AbstractFeature<2, T>;
#endif
/**
@brief Base feature for two-dimensional float scenes
@see @ref AbstractFeature3D
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef AbstractBasicFeature2D<Float> AbstractFeature2D;
#else
typedef AbstractFeature<2, Float> AbstractFeature2D;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief Base feature for three-dimensional scenes
Convenience alternative to <tt>%AbstractFeature<3, T></tt>. See
@ref AbstractFeature for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractFeature<3, T></tt> instead.
@see @ref AbstractFeature3D, @ref AbstractBasicFeature2D
*/
template<class T> using AbstractBasicFeature3D = AbstractFeature<3, T>;
#endif
/**
@brief Base feature for three-dimensional float scenes
@see @ref AbstractFeature2D
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef AbstractBasicFeature3D<Float> AbstractFeature3D;
#else
typedef AbstractFeature<3, Float> AbstractFeature3D;
#endif
#ifdef CORRADE_TARGET_WINDOWS
extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeature<2, Float>;

10
src/Magnum/SceneGraph/AbstractGroupedFeature.h

@ -107,14 +107,11 @@ template<UnsignedInt dimensions, class Derived, class T> class AbstractGroupedFe
FeatureGroup<dimensions, Derived, T>* _group;
};
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief Base grouped feature for two-dimensional scenes
Convenience alternative to <tt>%AbstractGroupedFeature<2, Derived, T></tt>. See
@ref AbstractGroupedFeature for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractGroupedFeature<2, Derived, T></tt>
instead.
@see @ref AbstractGroupedFeature2D, @ref AbstractBasicGroupedFeature3D
*/
template<class Derived, class T> using AbstractBasicGroupedFeature2D = AbstractGroupedFeature<2, Derived, T>;
@ -124,8 +121,6 @@ template<class Derived, class T> using AbstractBasicGroupedFeature2D = AbstractG
Convenience alternative to <tt>%AbstractBasicGroupedFeature2D<Derived, Float></tt>.
See @ref AbstractGroupedFeature for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractGroupedFeature<2, Derived, Float></tt>
instead.
@see @ref AbstractGroupedFeature3D
*/
template<class Derived> using AbstractGroupedFeature2D = AbstractBasicGroupedFeature2D<Derived, Float>;
@ -135,8 +130,6 @@ template<class Derived> using AbstractGroupedFeature2D = AbstractBasicGroupedFea
Convenience alternative to <tt>%AbstractGroupedFeature<3, Derived, T></tt>. See
@ref AbstractGroupedFeature for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractGroupedFeature<3, Derived, T></tt>
instead.
@see @ref AbstractGroupedFeature3D, @ref AbstractBasicGroupedFeature2D
*/
template<class Derived, class T> using AbstractBasicGroupedFeature3D = AbstractGroupedFeature<3, Derived, T>;
@ -146,12 +139,9 @@ template<class Derived, class T> using AbstractBasicGroupedFeature3D = AbstractG
Convenience alternative to <tt>%AbstractBasicGroupedFeature3D<Derived, Float></tt>.
See @ref AbstractGroupedFeature for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractGroupedFeature<3, Derived, Float></tt>
instead.
@see @ref AbstractGroupedFeature2D
*/
template<class Derived> using AbstractGroupedFeature3D = AbstractBasicGroupedFeature3D<Derived, Float>;
#endif
}}

10
src/Magnum/SceneGraph/AbstractObject.h

@ -266,40 +266,30 @@ template<UnsignedInt dimensions, class T> class AbstractObject
virtual void doSetClean(const std::vector<std::reference_wrapper<AbstractObject<dimensions, T>>>& objects) = 0;
};
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief Base object for two-dimensional scenes
Convenience alternative to <tt>%AbstractObject<2, T></tt>. See
@ref AbstractObject for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractObject<2, T></tt> instead.
@see @ref AbstractObject2D, @ref AbstractBasicObject3D
*/
template<class T> using AbstractBasicObject2D = AbstractObject<2, T>;
#endif
/**
@brief Base object for two-dimensional float scenes
@see @ref AbstractObject3D
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef AbstractBasicObject2D<Float> AbstractObject2D;
#else
typedef AbstractObject<2, Float> AbstractObject2D;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief Base object for three-dimensional scenes
Convenience alternative to <tt>%AbstractObject<3, T></tt>. See
@ref AbstractObject for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractObject<3, T></tt> instead.
@see @ref AbstractObject3D, @ref AbstractBasicObject2D
*/
template<class T> using AbstractBasicObject3D = AbstractObject<3, T>;
#endif
/**
@brief Base object for three-dimensional float scenes

16
src/Magnum/SceneGraph/AbstractTransformation.h

@ -97,53 +97,37 @@ enum class TransformationType: UnsignedByte {
Local = 0x01
};
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief Base transformation for two-dimensional scenes
Convenience alternative to <tt>%AbstractTransformation<2, T></tt>. See
@ref AbstractTransformation for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractTransformation<2, T></tt>
instead.
@see @ref AbstractTransformation2D, @ref AbstractBasicTransformation3D
*/
template<class T> using AbstractBasicTransformation2D = AbstractTransformation<2, T>;
#endif
/**
@brief Base transformation for two-dimensional float scenes
@see @ref AbstractTransformation3D
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef AbstractBasicTransformation2D<Float> AbstractTransformation2D;
#else
typedef AbstractTransformation<2, Float> AbstractTransformation2D;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief Base transformation for three-dimensional scenes
Convenience alternative to <tt>%AbstractTransformation<3, T></tt>. See
@ref AbstractTransformation for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractTransformation<3, T></tt>
instead.
@see @ref AbstractTransformation3D, @ref AbstractBasicTransformation2D
*/
template<class T> using AbstractBasicTransformation3D = AbstractTransformation<3, T>;
#endif
/**
@brief Base transformation for three-dimensional float scenes
@see @ref AbstractTransformation2D
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef AbstractBasicTransformation3D<Float> AbstractTransformation3D;
#else
typedef AbstractTransformation<3, Float> AbstractTransformation3D;
#endif
#ifdef CORRADE_TARGET_WINDOWS
extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractTransformation<2, Float>;

16
src/Magnum/SceneGraph/AbstractTranslation.h

@ -82,14 +82,11 @@ class AbstractTranslation: public AbstractTransformation<dimensions, T> {
virtual void doTranslate(const typename DimensionTraits<dimensions, TranslationType>::VectorType& vector, TransformationType type) = 0;
};
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief Base transformation for two-dimensional scenes supporting translation
Convenience alternative to <tt>%AbstractTranslation<2, T, TranslationType></tt>.
See @ref AbstractTranslation for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractTranslation<2, T, TranslationType></tt>
instead.
@see @ref AbstractTranslation2D, @ref AbstractBasicTranslation3D
*/
#ifdef DOXYGEN_GENERATING_OUTPUT
@ -98,27 +95,19 @@ template<class T, class TranslationType = T>
template<class T, class TranslationType>
#endif
using AbstractBasicTranslation2D = AbstractTranslation<2, T, TranslationType>;
#endif
/**
@brief Base transformation for two-dimensional float scenes supporting translation
@see @ref AbstractTranslation3D
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef AbstractBasicTranslation2D<Float> AbstractTranslation2D;
#else
typedef AbstractTranslation<2, Float> AbstractTranslation2D;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief Base transformation for three-dimensional scenes supporting translation
Convenience alternative to <tt>%AbstractTranslation<3, T, TranslationType></tt>.
See @ref AbstractTranslation for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractTranslation<3, T, TranslationType></tt>
instead.
@see @ref AbstractTranslation3D, @ref AbstractBasicTranslation2D
*/
#ifdef DOXYGEN_GENERATING_OUTPUT
@ -127,18 +116,13 @@ template<class T, class TranslationType = T>
template<class T, class TranslationType>
#endif
using AbstractBasicTranslation3D = AbstractTranslation<3, T, TranslationType>;
#endif
/**
@brief Base transformation for three-dimensional float scenes supporting translation
@see @ref AbstractTranslation2D
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef AbstractBasicTranslation3D<Float> AbstractTranslation3D;
#else
typedef AbstractTranslation<3, Float> AbstractTranslation3D;
#endif
}}

14
src/Magnum/SceneGraph/Animable.h

@ -336,51 +336,37 @@ template<UnsignedInt dimensions, class T> class Animable: public AbstractGrouped
UnsignedShort repeats;
};
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief %Animable for two-dimensional scenes
Convenience alternative to <tt>%Animable<2, T></tt>. See @ref Animable for more
information.
@note Not available on GCC < 4.7. Use <tt>%Animable<2, T></tt> instead.
@see @ref Animable2D, @ref BasicAnimable3D
*/
template<class T> using BasicAnimable2D = Animable<2, T>;
#endif
/**
@brief %Animable for two-dimensional float scenes
@see @ref Animable3D
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef BasicAnimable2D<Float> Animable2D;
#else
typedef Animable<2, Float> Animable2D;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief %Animable for three-dimensional scenes
Convenience alternative to <tt>%Animable<3, T></tt>. See @ref Animable for more
information.
@note Not available on GCC < 4.7. Use <tt>%Animable<3, T></tt> instead.
@see @ref Animable3D, @ref BasicAnimable2D
*/
template<class T> using BasicAnimable3D = Animable<3, T>;
#endif
/**
@brief %Animable for three-dimensional float scenes
@see @ref Animable2D
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef BasicAnimable3D<Float> Animable3D;
#else
typedef Animable<3, Float> Animable3D;
#endif
#ifdef CORRADE_TARGET_WINDOWS
extern template class MAGNUM_SCENEGRAPH_EXPORT Animable<2, Float>;

14
src/Magnum/SceneGraph/AnimableGroup.h

@ -72,51 +72,37 @@ template<UnsignedInt dimensions, class T> class AnimableGroup: public FeatureGro
bool wakeUp;
};
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief %Animable group for two-dimensional scenes
Convenience alternative to <tt>%AnimableGroup<2, T></tt>. See Animable for
more information.
@note Not available on GCC < 4.7. Use <tt>%AnimableGroup<2, T></tt> instead.
@see @ref AnimableGroup2D, @ref BasicAnimableGroup3D
*/
template<class T> using BasicAnimableGroup2D = AnimableGroup<2, T>;
#endif
/**
@brief %Animable group for two-dimensional float scenes
@see @ref AnimableGroup3D
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef BasicAnimableGroup2D<Float> AnimableGroup2D;
#else
typedef AnimableGroup<2, Float> AnimableGroup2D;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief %Animable group for three-dimensional scenes
Convenience alternative to <tt>%AnimableGroup<3, T></tt>. See Animable for
more information.
@note Not available on GCC < 4.7. Use <tt>%AnimableGroup<3, T></tt> instead.
@see @ref AnimableGroup3D, @ref BasicAnimableGroup2D
*/
template<class T> using BasicAnimableGroup3D = AnimableGroup<3, T>;
#endif
/**
@brief %Animable group for three-dimensional float scenes
@see @ref AnimableGroup2D
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef BasicAnimableGroup3D<Float> AnimableGroup3D;
#else
typedef AnimableGroup<3, Float> AnimableGroup3D;
#endif
#ifdef CORRADE_TARGET_WINDOWS
extern template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup<2, Float>;

7
src/Magnum/SceneGraph/Camera2D.h

@ -73,12 +73,7 @@ template<class T> class BasicCamera2D: public AbstractCamera<2, T> {
/* This is here to avoid ambiguity with deleted copy constructor when
passing `*this` from class subclassing both BasicCamera2D and
AbstractObject */
template<class U, class = typename std::enable_if<std::is_base_of<AbstractObject<2, T>, U>::value>::type> BasicCamera2D(U& object):
#ifndef CORRADE_GCC46_COMPATIBILITY
BasicCamera2D(static_cast<AbstractObject<2, T>&>(object)) {}
#else
AbstractCamera<2, T>(static_cast<AbstractObject<2, T>&>(object)) {}
#endif
template<class U, class = typename std::enable_if<std::is_base_of<AbstractObject<2, T>, U>::value>::type> BasicCamera2D(U& object): BasicCamera2D(static_cast<AbstractObject<2, T>&>(object)) {}
#endif
/**

7
src/Magnum/SceneGraph/Camera3D.h

@ -75,12 +75,7 @@ template<class T> class BasicCamera3D: public AbstractCamera<3, T> {
/* This is here to avoid ambiguity with deleted copy constructor when
passing `*this` from class subclassing both BasicCamera3D and
AbstractObject */
template<class U, class = typename std::enable_if<std::is_base_of<AbstractObject<3, T>, U>::value>::type> BasicCamera3D(U& object):
#ifndef CORRADE_GCC46_COMPATIBILITY
BasicCamera3D(static_cast<AbstractObject<3, T>&>(object)) {}
#else
AbstractCamera<3, T>(static_cast<AbstractObject<3, T>&>(object)) {}
#endif
template<class U, class = typename std::enable_if<std::is_base_of<AbstractObject<3, T>, U>::value>::type> BasicCamera3D(U& object): BasicCamera3D(static_cast<AbstractObject<3, T>&>(object)) {}
#endif
/**

40
src/Magnum/SceneGraph/Drawable.h

@ -148,20 +148,12 @@ template<UnsignedInt dimensions, class T> class Drawable: public AbstractGrouped
* If the drawable doesn't belong to any group, returns `nullptr`.
*/
DrawableGroup<dimensions, T>* drawables() {
#ifndef CORRADE_GCC46_COMPATIBILITY
return AbstractGroupedFeature<dimensions, Drawable<dimensions, T>, T>::group();
#else
return static_cast<DrawableGroup<dimensions, T>*>(AbstractGroupedFeature<dimensions, Drawable<dimensions, T>, T>::group());
#endif
}
/** @overload */
const DrawableGroup<dimensions, T>* drawables() const {
#ifndef CORRADE_GCC46_COMPATIBILITY
return AbstractGroupedFeature<dimensions, Drawable<dimensions, T>, T>::group();
#else
return static_cast<const DrawableGroup<dimensions, T>*>(AbstractGroupedFeature<dimensions, Drawable<dimensions, T>, T>::group());
#endif
}
/**
@ -176,51 +168,37 @@ template<UnsignedInt dimensions, class T> class Drawable: public AbstractGrouped
virtual void draw(const typename DimensionTraits<dimensions, T>::MatrixType& transformationMatrix, AbstractCamera<dimensions, T>& camera) = 0;
};
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief %Drawable for two-dimensional scenes
Convenience alternative to <tt>%Drawable<2, T></tt>. See @ref Drawable for more
information.
@note Not available on GCC < 4.7. Use <tt>%Drawable<2, T></tt> instead.
@see @ref Drawable2D, @ref BasicDrawable3D
*/
template<class T> using BasicDrawable2D = Drawable<2, T>;
#endif
/**
@brief %Drawable for two-dimensional float scenes
@see @ref Drawable3D
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef BasicDrawable2D<Float> Drawable2D;
#else
typedef Drawable<2, Float> Drawable2D;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief %Drawable for three-dimensional scenes
Convenience alternative to <tt>%Drawable<3, T></tt>. See @ref Drawable for more
information.
@note Not available on GCC < 4.7. Use <tt>%Drawable<3, T></tt> instead.
@see @ref Drawable3D, @ref BasicDrawable3D
*/
template<class T> using BasicDrawable3D = Drawable<3, T>;
#endif
/**
@brief %Drawable for three-dimensional float scenes
@see @ref Drawable2D
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef BasicDrawable3D<Float> Drawable3D;
#else
typedef Drawable<3, Float> Drawable3D;
#endif
/**
@brief Group of drawables
@ -229,57 +207,39 @@ See @ref Drawable for more information.
@see @ref scenegraph, @ref BasicDrawableGroup2D, @ref BasicDrawableGroup3D,
@ref DrawableGroup2D, @ref DrawableGroup3D
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
template<UnsignedInt dimensions, class T> using DrawableGroup = FeatureGroup<dimensions, Drawable<dimensions, T>, T>;
#else
template<UnsignedInt dimensions, class T> class DrawableGroup: public FeatureGroup<dimensions, Drawable<dimensions, T>, T> {};
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief Group of drawables for two-dimensional scenes
Convenience alternative to <tt>%DrawableGroup<2, T></tt>. See @ref Drawable for
more information.
@note Not available on GCC < 4.7. Use <tt>%DrawableGroup<2, T></tt> instead.
@see @ref DrawableGroup2D, @ref BasicDrawableGroup3D
*/
template<class T> using BasicDrawableGroup2D = DrawableGroup<2, T>;
#endif
/**
@brief Group of drawables for two-dimensional float scenes
@see @ref DrawableGroup3D
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef BasicDrawableGroup2D<Float> DrawableGroup2D;
#else
typedef DrawableGroup<2, Float> DrawableGroup2D;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief Group of drawables for three-dimensional scenes
Convenience alternative to <tt>%DrawableGroup<3, T></tt>. See @ref Drawable for
more information.
@note Not available on GCC < 4.7. Use <tt>%DrawableGroup<3, T></tt> instead.
@see @ref DrawableGroup3D, @ref BasicDrawableGroup2D
*/
template<class T> using BasicDrawableGroup3D = DrawableGroup<3, T>;
#endif
/**
@brief Group of drawables for three-dimensional float scenes
@see @ref DrawableGroup2D
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef BasicDrawableGroup3D<Float> DrawableGroup3D;
#else
typedef DrawableGroup<3, Float> DrawableGroup3D;
#endif
#ifdef CORRADE_TARGET_WINDOWS
extern template class MAGNUM_SCENEGRAPH_EXPORT Drawable<2, Float>;

10
src/Magnum/SceneGraph/FeatureGroup.h

@ -113,14 +113,11 @@ template<UnsignedInt dimensions, class Feature, class T> class FeatureGroup: pub
FeatureGroup<dimensions, Feature, T>& remove(Feature& feature);
};
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief Base feature group for two-dimensional scenes
Convenience alternative to <tt>%FeatureGroup<2, Feature, T></tt>. See
@ref AbstractGroupedFeature for more information.
@note Not available on GCC < 4.7. Use <tt>%FeatureGroup<2, Feature, T></tt>
instead.
@see @ref FeatureGroup2D, @ref BasicFeatureGroup3D
*/
template<class Feature, class T> using BasicFeatureGroup2D = FeatureGroup<2, Feature, T>;
@ -130,8 +127,6 @@ template<class Feature, class T> using BasicFeatureGroup2D = FeatureGroup<2, Fea
Convenience alternative to <tt>%BasicFeatureGroup2D<Feature, Float></tt>. See
@ref AbstractGroupedFeature for more information.
@note Not available on GCC < 4.7. Use <tt>%FeatureGroup<2, Feature, Float></tt>
instead.
@see @ref FeatureGroup3D
*/
template<class Feature> using FeatureGroup2D = BasicFeatureGroup2D<Feature, Float>;
@ -141,8 +136,6 @@ template<class Feature> using FeatureGroup2D = BasicFeatureGroup2D<Feature, Floa
Convenience alternative to <tt>%FeatureGroup<3, Feature, T></tt>. See
@ref AbstractGroupedFeature for more information.
@note Not available on GCC < 4.7. Use <tt>%FeatureGroup<3, Feature, T></tt>
instead.
@see @ref FeatureGroup3D, @ref BasicFeatureGroup2D
*/
template<class Feature, class T> using BasicFeatureGroup3D = FeatureGroup<3, Feature, T>;
@ -152,12 +145,9 @@ template<class Feature, class T> using BasicFeatureGroup3D = FeatureGroup<3, Fea
Convenience alternative to <tt>%BasicFeatureGroup3D<Feature, Float></tt>. See
@ref AbstractGroupedFeature for more information.
@note Not available on GCC < 4.7. Use <tt>%FeatureGroup<3, Feature, Float></tt>
instead.
@see @ref FeatureGroup2D
*/
template<class Feature> using FeatureGroup3D = BasicFeatureGroup3D<Feature, Float>;
#endif
template<UnsignedInt dimensions, class Feature, class T> FeatureGroup<dimensions, Feature, T>::~FeatureGroup() {
for(auto i: AbstractFeatureGroup<dimensions, T>::features) static_cast<Feature&>(i.get())._group = nullptr;

54
src/Magnum/SceneGraph/SceneGraph.h

@ -29,8 +29,6 @@
* @brief Forward declarations for @ref Magnum::SceneGraph namespace
*/
#include <Corrade/compatibility.h>
#include "Magnum/Types.h"
namespace Magnum { namespace SceneGraph {
@ -38,73 +36,46 @@ namespace Magnum { namespace SceneGraph {
enum class AspectRatioPolicy: UnsignedByte;
template<UnsignedInt, class> class AbstractCamera;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T> using AbstractBasicCamera2D = AbstractCamera<2, T>;
template<class T> using AbstractBasicCamera3D = AbstractCamera<3, T>;
typedef AbstractBasicCamera2D<Float> AbstractCamera2D;
typedef AbstractBasicCamera3D<Float> AbstractCamera3D;
#else
typedef AbstractCamera<2, Float> AbstractCamera2D;
typedef AbstractCamera<3, Float> AbstractCamera3D;
#endif
/* Enum CachedTransformation and CachedTransformations used only directly */
template<UnsignedInt, class> class AbstractFeature;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T> using AbstractBasicFeature2D = AbstractFeature<2, T>;
template<class T> using AbstractBasicFeature3D = AbstractFeature<3, T>;
typedef AbstractBasicFeature2D<Float> AbstractFeature2D;
typedef AbstractBasicFeature3D<Float> AbstractFeature3D;
#else
typedef AbstractFeature<2, Float> AbstractFeature2D;
typedef AbstractFeature<3, Float> AbstractFeature3D;
#endif
/* AbstractFeatureGroup shouldn't be used directly */
template<UnsignedInt, class, class> class AbstractGroupedFeature;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class Derived, class T> using AbstractBasicGroupedFeature2D = AbstractGroupedFeature<2, Derived, T>;
template<class Derived, class T> using AbstractBasicGroupedFeature3D = AbstractGroupedFeature<3, Derived, T>;
template<class Derived> using AbstractGroupedFeature2D = AbstractBasicGroupedFeature2D<Derived, Float>;
template<class Derived> using AbstractGroupedFeature3D = AbstractBasicGroupedFeature3D<Derived, Float>;
#endif
template<UnsignedInt, class> class AbstractObject;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T> using AbstractBasicObject2D = AbstractObject<2, T>;
template<class T> using AbstractBasicObject3D = AbstractObject<3, T>;
typedef AbstractBasicObject2D<Float> AbstractObject2D;
typedef AbstractBasicObject3D<Float> AbstractObject3D;
#else
typedef AbstractObject<2, Float> AbstractObject2D;
typedef AbstractObject<3, Float> AbstractObject3D;
#endif
enum class TransformationType: UnsignedByte;
template<UnsignedInt, class> class AbstractTransformation;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T> using AbstractBasicTransformation2D = AbstractTransformation<2, T>;
template<class T> using AbstractBasicTransformation3D = AbstractTransformation<3, T>;
typedef AbstractBasicTransformation2D<Float> AbstractTransformation2D;
typedef AbstractBasicTransformation3D<Float> AbstractTransformation3D;
#else
typedef AbstractTransformation<2, Float> AbstractTransformation2D;
typedef AbstractTransformation<3, Float> AbstractTransformation3D;
#endif
template<UnsignedInt, class T, class = T> class AbstractTranslation;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T, class TranslationType = T> using AbstractBasicTranslation2D = AbstractTranslation<2, T, TranslationType>;
template<class T, class TranslationType = T> using AbstractBasicTranslation3D = AbstractTranslation<3, T, TranslationType>;
typedef AbstractBasicTranslation2D<Float> AbstractTranslation2D;
typedef AbstractBasicTranslation3D<Float> AbstractTranslation3D;
#else
typedef AbstractTranslation<2, Float> AbstractTranslation2D;
typedef AbstractTranslation<3, Float> AbstractTranslation3D;
#endif
template<class> class AbstractBasicTranslationRotation2D;
template<class> class AbstractBasicTranslationRotation3D;
@ -117,28 +88,18 @@ typedef AbstractBasicTranslationRotationScaling2D<Float> AbstractTranslationRota
typedef AbstractBasicTranslationRotationScaling3D<Float> AbstractTranslationRotationScaling3D;
template<UnsignedInt, class> class Animable;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T> using BasicAnimable2D = Animable<2, T>;
template<class T> using BasicAnimable3D = Animable<3, T>;
typedef BasicAnimable2D<Float> Animable2D;
typedef BasicAnimable3D<Float> Animable3D;
#else
typedef Animable<2, Float> Animable2D;
typedef Animable<3, Float> Animable3D;
#endif
enum class AnimationState: UnsignedByte;
template<UnsignedInt, class> class AnimableGroup;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T> using BasicAnimableGroup2D = AnimableGroup<2, T>;
template<class T> using BasicAnimableGroup3D = AnimableGroup<3, T>;
typedef BasicAnimableGroup2D<Float> AnimableGroup2D;
typedef BasicAnimableGroup3D<Float> AnimableGroup3D;
#else
typedef AnimableGroup<2, Float> AnimableGroup2D;
typedef AnimableGroup<3, Float> AnimableGroup3D;
#endif
template<class> class BasicCamera2D;
template<class> class BasicCamera3D;
@ -146,12 +107,10 @@ typedef BasicCamera2D<Float> Camera2D;
typedef BasicCamera3D<Float> Camera3D;
template<UnsignedInt, class> class Drawable;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T> using BasicDrawable2D = Drawable<2, T>;
template<class T> using BasicDrawable3D = Drawable<3, T>;
typedef BasicDrawable2D<Float> Drawable2D;
typedef BasicDrawable3D<Float> Drawable3D;
#endif
template<class> class BasicDualComplexTransformation;
template<class> class BasicDualQuaternionTransformation;
@ -159,24 +118,16 @@ typedef BasicDualComplexTransformation<Float> DualComplexTransformation;
typedef BasicDualQuaternionTransformation<Float> DualQuaternionTransformation;
template<UnsignedInt, class, class> class FeatureGroup;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class Feature, class T> using BasicFeatureGroup2D = FeatureGroup<2, Feature, T>;
template<class Feature, class T> using BasicFeatureGroup3D = FeatureGroup<3, Feature, T>;
template<class Feature> using FeatureGroup2D = BasicFeatureGroup2D<Feature, Float>;
template<class Feature> using FeatureGroup3D = BasicFeatureGroup3D<Feature, Float>;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
template<UnsignedInt dimensions, class T> using DrawableGroup = FeatureGroup<dimensions, Drawable<dimensions, T>, T>;
template<class T> using BasicDrawableGroup2D = DrawableGroup<2, T>;
template<class T> using BasicDrawableGroup3D = DrawableGroup<3, T>;
typedef BasicDrawableGroup2D<Float> DrawableGroup2D;
typedef BasicDrawableGroup3D<Float> DrawableGroup3D;
#else
template<UnsignedInt, class> class DrawableGroup;
typedef DrawableGroup<2, Float> DrawableGroup2D;
typedef DrawableGroup<3, Float> DrawableGroup3D;
#endif
template<class> class BasicMatrixTransformation2D;
template<class> class BasicMatrixTransformation3D;
@ -193,15 +144,10 @@ typedef BasicRigidMatrixTransformation3D<Float> RigidMatrixTransformation3D;
template<class Transformation> class Scene;
template<UnsignedInt, class T, class = T> class TranslationTransformation;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T, class TranslationType = T> using BasicTranslationTransformation2D = TranslationTransformation<2, T, TranslationType>;
template<class T, class TranslationType = T> using BasicTranslationTransformation3D = TranslationTransformation<3, T, TranslationType>;
typedef BasicTranslationTransformation2D<Float> TranslationTransformation2D;
typedef BasicTranslationTransformation3D<Float> TranslationTransformation3D;
#else
typedef TranslationTransformation<2, Float> TranslationTransformation2D;
typedef TranslationTransformation<3, Float> TranslationTransformation3D;
#endif
namespace Implementation {
template<class> struct Transformation;

16
src/Magnum/SceneGraph/TranslationTransformation.h

@ -126,14 +126,11 @@ class TranslationTransformation: public AbstractTranslation<dimensions, T, Trans
typename DimensionTraits<dimensions, TranslationType>::VectorType _transformation;
};
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief Base transformation for two-dimensional scenes supporting translation
Convenience alternative to <tt>%TranslationTransformation<2, T, TranslationType></tt>.
See @ref TranslationTransformation for more information.
@note Not available on GCC < 4.7. Use <tt>%TranslationTransformation<2, T, TranslationType></tt>
instead.
@see @ref TranslationTransformation2D, @ref BasicTranslationTransformation3D
*/
#ifdef DOXYGEN_GENERATING_OUTPUT
@ -142,27 +139,19 @@ template<class T, class TranslationType = T>
template<class T, class TranslationType>
#endif
using BasicTranslationTransformation2D = TranslationTransformation<2, T, TranslationType>;
#endif
/**
@brief Base transformation for two-dimensional float scenes supporting translation
@see @ref TranslationTransformation3D
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef BasicTranslationTransformation2D<Float> TranslationTransformation2D;
#else
typedef TranslationTransformation<2, Float> TranslationTransformation2D;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/**
@brief Base transformation for three-dimensional scenes supporting translation
Convenience alternative to <tt>%TranslationTransformation<3, T, TranslationType></tt>.
See @ref TranslationTransformation for more information.
@note Not available on GCC < 4.7. Use <tt>%TranslationTransformation<3, T, TranslationType></tt>
instead.
@see @ref TranslationTransformation3D, @ref BasicTranslationTransformation2D
*/
#ifdef DOXYGEN_GENERATING_OUTPUT
@ -171,18 +160,13 @@ template<class T, class TranslationType = T>
template<class T, class TranslationType>
#endif
using BasicTranslationTransformation3D = TranslationTransformation<3, T, TranslationType>;
#endif
/**
@brief Base transformation for three-dimensional float scenes supporting translation
@see @ref TranslationTransformation2D
*/
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef BasicTranslationTransformation3D<Float> TranslationTransformation3D;
#else
typedef TranslationTransformation<3, Float> TranslationTransformation3D;
#endif
namespace Implementation {

1
src/Magnum/Shapes/shapeImplementation.h

@ -26,7 +26,6 @@
*/
#include <utility>
#include <Corrade/compatibility.h>
#include <Corrade/Utility/Assert.h>
#include "Magnum/DimensionTraits.h"

1
src/Magnum/Test/AbstractOpenGLTester.h

@ -26,7 +26,6 @@
*/
#include <Corrade/TestSuite/Tester.h>
#include <Corrade/compatibility.h>
#include "Magnum/Context.h"
#include "Magnum/Extensions.h"

3
src/Magnum/Test/AbstractQueryGLTest.cpp

@ -65,10 +65,7 @@ void AbstractQueryGLTest::construct() {
void AbstractQueryGLTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<SampleQuery, const SampleQuery&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<SampleQuery, const SampleQuery&>{}));
#endif
}
void AbstractQueryGLTest::constructMove() {

3
src/Magnum/Test/AbstractShaderProgramGLTest.cpp

@ -96,10 +96,7 @@ void AbstractShaderProgramGLTest::construct() {
void AbstractShaderProgramGLTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<DummyShader, const DummyShader&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<DummyShader, const DummyShader&>{}));
#endif
}
void AbstractShaderProgramGLTest::constructMove() {

3
src/Magnum/Test/AbstractTextureGLTest.cpp

@ -62,10 +62,7 @@ void AbstractTextureGLTest::construct() {
void AbstractTextureGLTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<Texture2D, const Texture2D&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<Texture2D, const Texture2D&>{}));
#endif
}
void AbstractTextureGLTest::constructMove() {

4
src/Magnum/Test/ArrayTest.cpp

@ -52,11 +52,7 @@ void ArrayTest::construct() {
constexpr Array<3, Int> a = {5, 6, 7};
CORRADE_COMPARE(a, (Array<3, Int>(5, 6, 7)));
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr Array<3, Int> a2 = 5;
#else
Array<3, Int> a2 = 5; /* Not constexpr under GCC < 4.7 */
#endif
CORRADE_COMPARE(a2, (Array<3, Int>(5, 5, 5)));
constexpr Array1D b = 5;

3
src/Magnum/Test/BufferGLTest.cpp

@ -87,10 +87,7 @@ void BufferGLTest::construct() {
void BufferGLTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<Buffer, const Buffer&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<Buffer, const Buffer&>{}));
#endif
}
void BufferGLTest::constructMove() {

3
src/Magnum/Test/BufferImageGLTest.cpp

@ -74,10 +74,7 @@ void BufferImageTest::construct() {
void BufferImageTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<BufferImage2D, const BufferImage2D&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<BufferImage2D, const BufferImage2D&>{}));
#endif
}
void BufferImageTest::constructMove() {

15
src/Magnum/Test/ColorTest.cpp

@ -115,10 +115,7 @@ void ColorTest::constructDefault() {
}
void ColorTest::constructOneValue() {
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Color3 a(0.25f);
constexpr Color3 a(0.25f);
CORRADE_COMPARE(a, Color3(0.25f, 0.25f, 0.25f));
constexpr Color4 b(0.25f, 0.5f);
@ -151,17 +148,11 @@ void ColorTest::constructParts() {
void ColorTest::constructConversion() {
constexpr Color3 a(10.1f, 12.5f, 0.75f);
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Color3ub b(a);
constexpr Color3ub b(a);
CORRADE_COMPARE(b, Color3ub(10, 12, 0));
constexpr Color4 c(10.1f, 12.5f, 0.75f, 5.25f);
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Color4ub d(c);
constexpr Color4ub d(c);
CORRADE_COMPARE(d, Color4ub(10, 12, 0, 5));
/* Implicit conversion is not allowed */

3
src/Magnum/Test/FramebufferGLTest.cpp

@ -156,10 +156,7 @@ void FramebufferGLTest::construct() {
void FramebufferGLTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<Framebuffer, const Framebuffer&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<Framebuffer, const Framebuffer&>{}));
#endif
}
void FramebufferGLTest::constructMove() {

3
src/Magnum/Test/ImageTest.cpp

@ -65,10 +65,7 @@ void ImageTest::construct() {
void ImageTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<Image2D, const Image2D&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<Image2D, const Image2D&>{}));
#endif
}
void ImageTest::constructMove() {

3
src/Magnum/Test/MeshGLTest.cpp

@ -247,10 +247,7 @@ void MeshGLTest::construct() {
void MeshGLTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<Mesh, const Mesh&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<Mesh, const Mesh&>{}));
#endif
}
void MeshGLTest::constructMove() {

3
src/Magnum/Test/RenderbufferGLTest.cpp

@ -75,10 +75,7 @@ void RenderbufferGLTest::construct() {
void RenderbufferGLTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<Renderbuffer, const Renderbuffer&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<Renderbuffer, const Renderbuffer&>{}));
#endif
}
void RenderbufferGLTest::constructMove() {

1
src/Magnum/Test/ResourceManagerTest.cpp

@ -24,7 +24,6 @@
*/
#include <sstream>
#include <Corrade/compatibility.h>
#include <Corrade/TestSuite/Tester.h>
#include "Magnum/AbstractResourceLoader.h"

3
src/Magnum/Test/ShaderGLTest.cpp

@ -91,10 +91,7 @@ void ShaderGLTest::constructNoVersion() {
void ShaderGLTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<Shader, const Shader&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<Shader, const Shader&>{}));
#endif
}
void ShaderGLTest::constructMove() {

3
src/Magnum/Trade/Test/ImageDataTest.cpp

@ -63,10 +63,7 @@ void ImageDataTest::construct() {
void ImageDataTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<Trade::ImageData2D, const Trade::ImageData2D&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<Trade::ImageData2D, const Trade::ImageData2D&>{}));
#endif
}
void ImageDataTest::constructMove() {

8
src/MagnumPlugins/MagnumFont/MagnumFont.cpp

@ -37,10 +37,6 @@
namespace Magnum { namespace Text {
struct MagnumFont::Data {
#ifdef CORRADE_GCC46_COMPATIBILITY
explicit Data(Utility::Configuration&& conf, Trade::ImageData2D&& image, std::unordered_map<char32_t, UnsignedInt>&& glyphId, std::vector<Vector2>&& glyphAdvance): conf(std::move(conf)), image(std::move(image)), glyphId(std::move(glyphId)), glyphAdvance(std::move(glyphAdvance)) {}
#endif
Utility::Configuration conf;
Trade::ImageData2D image;
std::unordered_map<char32_t, UnsignedInt> glyphId;
@ -162,11 +158,7 @@ std::pair<Float, Float> MagnumFont::openInternal(Utility::Configuration&& conf,
for(const Utility::ConfigurationGroup* const c: chars) {
const UnsignedInt glyphId = c->value<UnsignedInt>("glyph");
CORRADE_INTERNAL_ASSERT(glyphId < _opened->glyphAdvance.size());
#ifndef CORRADE_GCC46_COMPATIBILITY
_opened->glyphId.emplace(c->value<char32_t>("unicode"), glyphId);
#else
_opened->glyphId.insert({c->value<char32_t>("unicode"), glyphId});
#endif
}
return {_opened->conf.value<Float>("fontSize"), _opened->conf.value<Float>("lineHeight")};

8
src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp

@ -64,17 +64,9 @@ std::vector<std::pair<std::string, Containers::Array<unsigned char>>> MagnumFont
should stay at position 0 */
std::unordered_map<UnsignedInt, UnsignedInt> glyphIdMap;
glyphIdMap.reserve(cache.glyphCount());
#ifndef CORRADE_GCC46_COMPATIBILITY
glyphIdMap.emplace(0, 0);
#else
glyphIdMap.insert({0, 0});
#endif
for(const std::pair<UnsignedInt, std::pair<Vector2i, Range2Di>>& glyph: cache)
#ifndef CORRADE_GCC46_COMPATIBILITY
glyphIdMap.emplace(glyph.first, glyphIdMap.size());
#else
glyphIdMap.insert({glyph.first, glyphIdMap.size()});
#endif
/** @todo Save only glyphs contained in @p characters */

8
src/MagnumPlugins/ObjImporter/ObjImporter.cpp

@ -175,11 +175,7 @@ void ObjImporter::parseMeshNames() {
/* Update its name and add it to name map */
if(!name.empty())
#ifndef CORRADE_GCC46_COMPATIBILITY
_file->meshesForName.emplace(name, _file->meshes.size() - 1);
#else
_file->meshesForName.insert({name, _file->meshes.size() - 1});
#endif
_file->meshNames.back() = std::move(name);
/* Update its begin offset to be more precise */
@ -193,11 +189,7 @@ void ObjImporter::parseMeshNames() {
/* Save name and offset of the new one. The end offset will be
updated later. */
if(!name.empty())
#ifndef CORRADE_GCC46_COMPATIBILITY
_file->meshesForName.emplace(name, _file->meshes.size());
#else
_file->meshesForName.insert({name, _file->meshes.size()});
#endif
_file->meshNames.emplace_back(std::move(name));
_file->meshes.emplace_back(_file->in->tellg(), 0, positionIndexOffset, textureCoordinateIndexOffset, normalIndexOffset);
}

Loading…
Cancel
Save