Workaround GCC compiler bug with constexpr support

This commit is contained in:
Christophe Riccio 2016-05-05 19:47:42 +02:00
parent e8ff04aaec
commit 152c71abff
2 changed files with 10 additions and 2 deletions

View File

@ -102,7 +102,15 @@ namespace glm
// -- Explicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec1(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR explicit tvec1(T scalar);
// GCC 4.6 has a bug causing a compiler crash
# if GLM_COMPILER & GLM_COMPILER_GCC
# define GLM_CONSTEXPR_GCC
# else
# define GLM_CONSTEXPR_GCC GLM_CONSTEXPR
# endif
GLM_FUNC_DECL GLM_CONSTEXPR_GCC explicit tvec1(T scalar);
// -- Conversion vector constructors --

View File

@ -63,7 +63,7 @@ namespace glm
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec1<T, P>::tvec1(T scalar)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_GCC tvec1<T, P>::tvec1(T scalar)
: x(scalar)
{}