mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 12:41:54 +00:00
Workaround GCC compiler bug with constexpr support
This commit is contained in:
parent
152c71abff
commit
71401d14aa
@ -737,6 +737,13 @@
|
||||
# define GLM_RELAXED_CONSTEXPR const
|
||||
#endif
|
||||
|
||||
// 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
|
||||
|
||||
#ifdef GLM_FORCE_EXPLICIT_CTOR
|
||||
# define GLM_EXPLICIT explicit
|
||||
#else
|
||||
|
@ -102,14 +102,6 @@ namespace glm
|
||||
// -- Explicit basic constructors --
|
||||
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec1(ctor);
|
||||
|
||||
// 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 --
|
||||
|
@ -102,7 +102,7 @@ namespace glm
|
||||
// -- Explicit basic constructors --
|
||||
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec2(ctor);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR explicit tvec2(T scalar);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_GCC explicit tvec2(T scalar);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR tvec2(T s1, T s2);
|
||||
|
||||
// -- Conversion constructors --
|
||||
|
@ -72,7 +72,7 @@ namespace glm
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec2<T, P>::tvec2(T scalar)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_GCC tvec2<T, P>::tvec2(T scalar)
|
||||
: x(scalar), y(scalar)
|
||||
{}
|
||||
|
||||
|
@ -103,7 +103,7 @@ namespace glm
|
||||
// -- Explicit basic constructors --
|
||||
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec3(ctor);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR explicit tvec3(T scalar);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_GCC explicit tvec3(T scalar);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR tvec3(T a, T b, T c);
|
||||
|
||||
// -- Conversion scalar constructors --
|
||||
|
@ -89,7 +89,7 @@ namespace glm
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3<T, P>::tvec3(T scalar)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_GCC tvec3<T, P>::tvec3(T scalar)
|
||||
: x(scalar), y(scalar), z(scalar)
|
||||
{}
|
||||
|
||||
|
@ -158,7 +158,7 @@ namespace detail
|
||||
// -- Explicit basic constructors --
|
||||
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec4(ctor);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR explicit tvec4(T scalar);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR_GCC explicit tvec4(T scalar);
|
||||
GLM_FUNC_DECL GLM_CONSTEXPR tvec4(T a, T b, T c, T d);
|
||||
|
||||
// -- Conversion scalar constructors --
|
||||
|
@ -63,7 +63,7 @@ namespace glm
|
||||
{}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4<T, P>::tvec4(T scalar)
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_GCC tvec4<T, P>::tvec4(T scalar)
|
||||
: x(scalar), y(scalar), z(scalar), w(scalar)
|
||||
{}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user