Browse Source

GCC 4.5 compatibility: constexpr-related issues.

Vladimír Vondruš 11 years ago
parent
commit
b61d231f08
  1. 5
      src/Magnum/MultisampleTexture.h
  2. 7
      src/Magnum/Texture.h
  3. 5
      src/Magnum/TextureArray.h

5
src/Magnum/MultisampleTexture.h

@ -40,9 +40,10 @@ namespace Magnum {
namespace Implementation { namespace Implementation {
template<UnsignedInt> constexpr GLenum multisampleTextureTarget(); template<UnsignedInt> constexpr GLenum multisampleTextureTarget();
template<> constexpr GLenum multisampleTextureTarget<2>() { return GL_TEXTURE_2D_MULTISAMPLE; } /* GCC 4.5 doesn't have constexpr, so it needs inline */
template<> constexpr inline GLenum multisampleTextureTarget<2>() { return GL_TEXTURE_2D_MULTISAMPLE; }
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
template<> constexpr GLenum multisampleTextureTarget<3>() { return GL_TEXTURE_2D_MULTISAMPLE_ARRAY; } template<> constexpr inline GLenum multisampleTextureTarget<3>() { return GL_TEXTURE_2D_MULTISAMPLE_ARRAY; }
#endif #endif
template<UnsignedInt dimensions> typename DimensionTraits<dimensions, Int>::VectorType maxMultisampleTextureSize(); template<UnsignedInt dimensions> typename DimensionTraits<dimensions, Int>::VectorType maxMultisampleTextureSize();

7
src/Magnum/Texture.h

@ -40,11 +40,12 @@ namespace Magnum {
namespace Implementation { namespace Implementation {
template<UnsignedInt> constexpr GLenum textureTarget(); template<UnsignedInt> constexpr GLenum textureTarget();
/* GCC 4.5 doesn't have constexpr, so it needs inline */
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
template<> constexpr GLenum textureTarget<1>() { return GL_TEXTURE_1D; } template<> constexpr inline GLenum textureTarget<1>() { return GL_TEXTURE_1D; }
#endif #endif
template<> constexpr GLenum textureTarget<2>() { return GL_TEXTURE_2D; } template<> constexpr inline GLenum textureTarget<2>() { return GL_TEXTURE_2D; }
template<> constexpr GLenum textureTarget<3>() { template<> constexpr inline GLenum textureTarget<3>() {
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
return GL_TEXTURE_3D; return GL_TEXTURE_3D;
#else #else

5
src/Magnum/TextureArray.h

@ -41,10 +41,11 @@ namespace Magnum {
namespace Implementation { namespace Implementation {
template<UnsignedInt> constexpr GLenum textureArrayTarget(); template<UnsignedInt> constexpr GLenum textureArrayTarget();
/* GCC 4.5 doesn't have constexpr, so it needs inline */
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
template<> constexpr GLenum textureArrayTarget<1>() { return GL_TEXTURE_1D_ARRAY; } template<> constexpr inline GLenum textureArrayTarget<1>() { return GL_TEXTURE_1D_ARRAY; }
#endif #endif
template<> constexpr GLenum textureArrayTarget<2>() { return GL_TEXTURE_2D_ARRAY; } template<> constexpr inline GLenum textureArrayTarget<2>() { return GL_TEXTURE_2D_ARRAY; }
} }
/** /**

Loading…
Cancel
Save