From 8390a77b3a278b15259e5ca6e67f7e41badc457b Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Tue, 27 Mar 2018 18:23:37 +0200 Subject: [PATCH] Added GLM_FORCE_CTOR_INIT #735 #740 --- glm/detail/setup.hpp | 11 +++++++++++ glm/detail/type_mat2x2.hpp | 2 +- glm/detail/type_mat2x2.inl | 9 +++++++-- glm/detail/type_mat2x3.hpp | 2 +- glm/detail/type_mat2x3.inl | 9 +++++++-- glm/detail/type_mat2x4.hpp | 2 +- glm/detail/type_mat2x4.inl | 9 +++++++-- glm/detail/type_mat3x2.hpp | 2 +- glm/detail/type_mat3x2.inl | 10 ++++++++-- glm/detail/type_mat3x3.hpp | 2 +- glm/detail/type_mat3x3.inl | 10 ++++++++-- glm/detail/type_mat3x4.hpp | 2 +- glm/detail/type_mat3x4.inl | 10 ++++++++-- glm/detail/type_mat4x2.hpp | 2 +- glm/detail/type_mat4x2.inl | 11 +++++++++-- glm/detail/type_mat4x3.hpp | 2 +- glm/detail/type_mat4x3.inl | 11 +++++++++-- glm/detail/type_mat4x4.hpp | 2 +- glm/detail/type_mat4x4.inl | 11 +++++++++-- glm/detail/type_vec1.inl | 7 +++++-- glm/detail/type_vec2.hpp | 2 +- glm/detail/type_vec2.inl | 7 +++++-- glm/detail/type_vec3.hpp | 2 +- glm/detail/type_vec3.inl | 7 +++++-- glm/detail/type_vec4.hpp | 2 +- glm/detail/type_vec4.inl | 7 +++++-- glm/ext/vec1.hpp | 2 +- glm/gtc/quaternion.hpp | 2 +- glm/gtc/quaternion.inl | 5 ++++- glm/gtx/dual_quaternion.hpp | 2 +- glm/gtx/dual_quaternion.inl | 6 +++++- 31 files changed, 127 insertions(+), 43 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 050978c6..d6e7ba1a 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -720,8 +720,19 @@ #if GLM_HAS_DEFAULTED_FUNCTIONS # define GLM_DEFAULT = default + +# ifdef GLM_FORCE_NO_CTOR_INIT +# undef GLM_FORCE_CTOR_INIT +# endif + +# ifdef GLM_FORCE_CTOR_INIT +# define GLM_DEFAULT_CTOR +# else +# define GLM_DEFAULT_CTOR = default +# endif #else # define GLM_DEFAULT +# define GLM_DEFAULT_CTOR #endif #if GLM_HAS_CONSTEXPR || GLM_HAS_CONSTEXPR_PARTIAL diff --git a/glm/detail/type_mat2x2.hpp b/glm/detail/type_mat2x2.hpp index ed9b782f..47e28cba 100644 --- a/glm/detail/type_mat2x2.hpp +++ b/glm/detail/type_mat2x2.hpp @@ -34,7 +34,7 @@ namespace glm // -- Constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, Q> const& m) GLM_DEFAULT; template GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 2, T, P> const& m); diff --git a/glm/detail/type_mat2x2.inl b/glm/detail/type_mat2x2.inl index 3c7fae56..72971d8c 100644 --- a/glm/detail/type_mat2x2.inl +++ b/glm/detail/type_mat2x2.inl @@ -7,10 +7,15 @@ namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 2, T, Q>::mat() - {} + { +# ifdef GLM_FORCE_CTOR_INIT + this->value[0] = col_type(1, 0); + this->value[1] = col_type(0, 1); +# endif + } # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS diff --git a/glm/detail/type_mat2x3.hpp b/glm/detail/type_mat2x3.hpp index 657f5fd8..0f4b43ad 100644 --- a/glm/detail/type_mat2x3.hpp +++ b/glm/detail/type_mat2x3.hpp @@ -35,7 +35,7 @@ namespace glm // -- Constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, Q> const& m) GLM_DEFAULT; template GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 3, T, P> const& m); diff --git a/glm/detail/type_mat2x3.inl b/glm/detail/type_mat2x3.inl index 119674cc..de9cbf0f 100644 --- a/glm/detail/type_mat2x3.inl +++ b/glm/detail/type_mat2x3.inl @@ -5,10 +5,15 @@ namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 3, T, Q>::mat() - {} + { +# ifdef GLM_FORCE_CTOR_INIT + this->value[0] = col_type(1, 0, 0); + this->value[1] = col_type(0, 1, 0); +# endif + } # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index a3cd52d6..366f7838 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -35,7 +35,7 @@ namespace glm // -- Constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, Q> const& m) GLM_DEFAULT; template GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<2, 4, T, P> const& m); diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index 851ad30d..0f3f631b 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -5,10 +5,15 @@ namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<2, 4, T, Q>::mat() - {} + { +# ifdef GLM_FORCE_CTOR_INIT + this->value[0] = col_type(1, 0, 0, 0); + this->value[1] = col_type(0, 1, 0, 0); +# endif + } # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS diff --git a/glm/detail/type_mat3x2.hpp b/glm/detail/type_mat3x2.hpp index 7320a48a..cb7f0bb5 100644 --- a/glm/detail/type_mat3x2.hpp +++ b/glm/detail/type_mat3x2.hpp @@ -35,7 +35,7 @@ namespace glm // -- Constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, Q> const& m) GLM_DEFAULT; template GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 2, T, P> const& m); diff --git a/glm/detail/type_mat3x2.inl b/glm/detail/type_mat3x2.inl index a8458eab..9b789d09 100644 --- a/glm/detail/type_mat3x2.inl +++ b/glm/detail/type_mat3x2.inl @@ -5,10 +5,16 @@ namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 2, T, Q>::mat() - {} + { +# ifdef GLM_FORCE_CTOR_INIT + this->value[0] = col_type(1, 0); + this->value[1] = col_type(0, 1); + this->value[2] = col_type(0, 0); +# endif + } # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS diff --git a/glm/detail/type_mat3x3.hpp b/glm/detail/type_mat3x3.hpp index 942ecefe..f6e2d159 100644 --- a/glm/detail/type_mat3x3.hpp +++ b/glm/detail/type_mat3x3.hpp @@ -34,7 +34,7 @@ namespace glm // -- Constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, Q> const& m) GLM_DEFAULT; template GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 3, T, P> const& m); diff --git a/glm/detail/type_mat3x3.inl b/glm/detail/type_mat3x3.inl index 1f5fadc3..81338a35 100644 --- a/glm/detail/type_mat3x3.inl +++ b/glm/detail/type_mat3x3.inl @@ -7,10 +7,16 @@ namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 3, T, Q>::mat() - {} + { +# ifdef GLM_FORCE_CTOR_INIT + this->value[0] = col_type(1, 0, 0); + this->value[1] = col_type(0, 1, 0); + this->value[2] = col_type(0, 0, 1); +# endif + } # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS diff --git a/glm/detail/type_mat3x4.hpp b/glm/detail/type_mat3x4.hpp index 3489ef96..7e02d6e6 100644 --- a/glm/detail/type_mat3x4.hpp +++ b/glm/detail/type_mat3x4.hpp @@ -35,7 +35,7 @@ namespace glm // -- Constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, Q> const& m) GLM_DEFAULT; template GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<3, 4, T, P> const& m); diff --git a/glm/detail/type_mat3x4.inl b/glm/detail/type_mat3x4.inl index e0194238..c8562d15 100644 --- a/glm/detail/type_mat3x4.inl +++ b/glm/detail/type_mat3x4.inl @@ -5,10 +5,16 @@ namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<3, 4, T, Q>::mat() - {} + { +# ifdef GLM_FORCE_CTOR_INIT + this->value[0] = col_type(1, 0, 0, 0); + this->value[1] = col_type(0, 1, 0, 0); + this->value[2] = col_type(0, 0, 1, 0); +# endif + } # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS diff --git a/glm/detail/type_mat4x2.hpp b/glm/detail/type_mat4x2.hpp index ed8b7b31..9064dd3c 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -35,7 +35,7 @@ namespace glm // -- Constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, Q> const& m) GLM_DEFAULT; template GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 2, T, P> const& m); diff --git a/glm/detail/type_mat4x2.inl b/glm/detail/type_mat4x2.inl index f7668350..f0ac30fe 100644 --- a/glm/detail/type_mat4x2.inl +++ b/glm/detail/type_mat4x2.inl @@ -5,10 +5,17 @@ namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 2, T, Q>::mat() - {} + { +# ifdef GLM_FORCE_CTOR_INIT + this->value[0] = col_type(1, 0); + this->value[1] = col_type(0, 1); + this->value[2] = col_type(0, 0); + this->value[3] = col_type(0, 0); +# endif + } # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS diff --git a/glm/detail/type_mat4x3.hpp b/glm/detail/type_mat4x3.hpp index 3d956c09..a17add57 100644 --- a/glm/detail/type_mat4x3.hpp +++ b/glm/detail/type_mat4x3.hpp @@ -35,7 +35,7 @@ namespace glm // -- Constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, Q> const& m) GLM_DEFAULT; template GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 3, T, P> const& m); diff --git a/glm/detail/type_mat4x3.inl b/glm/detail/type_mat4x3.inl index 9add287f..df50b001 100644 --- a/glm/detail/type_mat4x3.inl +++ b/glm/detail/type_mat4x3.inl @@ -5,10 +5,17 @@ namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 3, T, Q>::mat() - {} + { +# ifdef GLM_FORCE_CTOR_INIT + this->value[0] = col_type(1, 0, 0); + this->value[1] = col_type(0, 1, 0); + this->value[2] = col_type(0, 0, 1); + this->value[3] = col_type(0, 0, 0); +# endif + } # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS diff --git a/glm/detail/type_mat4x4.hpp b/glm/detail/type_mat4x4.hpp index a1a11e31..694dcd00 100644 --- a/glm/detail/type_mat4x4.hpp +++ b/glm/detail/type_mat4x4.hpp @@ -34,7 +34,7 @@ namespace glm // -- Constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, Q> const& m) GLM_DEFAULT; template GLM_FUNC_DECL GLM_CONSTEXPR_CTOR_CXX14 mat(mat<4, 4, T, P> const& m); diff --git a/glm/detail/type_mat4x4.inl b/glm/detail/type_mat4x4.inl index aa7b6b29..26157c6a 100644 --- a/glm/detail/type_mat4x4.inl +++ b/glm/detail/type_mat4x4.inl @@ -7,10 +7,17 @@ namespace glm { // -- Constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR_CXX14 mat<4, 4, T, Q>::mat() - {} + { +# ifdef GLM_FORCE_CTOR_INIT + this->value[0] = col_type(1, 0, 0, 0); + this->value[1] = col_type(0, 1, 0, 0); + this->value[2] = col_type(0, 0, 1, 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif + } # endif # if !GLM_HAS_DEFAULTED_FUNCTIONS diff --git a/glm/detail/type_vec1.inl b/glm/detail/type_vec1.inl index e050883d..7f77f6c2 100644 --- a/glm/detail/type_vec1.inl +++ b/glm/detail/type_vec1.inl @@ -5,11 +5,14 @@ namespace glm { // -- Implicit basic constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec() +# ifdef GLM_FORCE_CTOR_INIT + : x(0) +# endif {} -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) # if !GLM_HAS_DEFAULTED_FUNCTIONS template diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index 32aa32db..b6ab6853 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -86,7 +86,7 @@ namespace glm // -- Implicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec() GLM_DEFAULT_CTOR; GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec const& v) GLM_DEFAULT; template GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<2, T, P> const& v); diff --git a/glm/detail/type_vec2.inl b/glm/detail/type_vec2.inl index c2f4de25..12737079 100644 --- a/glm/detail/type_vec2.inl +++ b/glm/detail/type_vec2.inl @@ -5,11 +5,14 @@ namespace glm { // -- Implicit basic constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, Q>::vec() +# ifdef GLM_FORCE_CTOR_INIT + : x(0), y(0) +# endif {} -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) # if !GLM_HAS_DEFAULTED_FUNCTIONS template diff --git a/glm/detail/type_vec3.hpp b/glm/detail/type_vec3.hpp index beaaee5b..506e8a36 100644 --- a/glm/detail/type_vec3.hpp +++ b/glm/detail/type_vec3.hpp @@ -86,7 +86,7 @@ namespace glm // -- Implicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec() GLM_DEFAULT_CTOR; GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec const& v) GLM_DEFAULT; template GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<3, T, P> const& v); diff --git a/glm/detail/type_vec3.inl b/glm/detail/type_vec3.inl index c90cd3ab..15fd4839 100644 --- a/glm/detail/type_vec3.inl +++ b/glm/detail/type_vec3.inl @@ -5,11 +5,14 @@ namespace glm { // -- Implicit basic constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, Q>::vec() +# ifdef GLM_FORCE_CTOR_INIT + : x(0), y(0), z(0) +# endif {} -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) # if !GLM_HAS_DEFAULTED_FUNCTIONS template diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index a83e260f..43395ca4 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -89,7 +89,7 @@ namespace glm // -- Implicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec() GLM_DEFAULT_CTOR; GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(vec<4, T, Q> const& v) GLM_DEFAULT; template GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(vec<4, T, P> const& v); diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 93b8daeb..972cb4e4 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -158,11 +158,14 @@ namespace detail // -- Implicit basic constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, T, Q>::vec() +# ifdef GLM_FORCE_CTOR_INIT + : x(0), y(0), z(0), w(0) +# endif {} -# endif//!GLM_HAS_DEFAULTED_FUNCTIONS +# endif//!GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) # if !GLM_HAS_DEFAULTED_FUNCTIONS template diff --git a/glm/ext/vec1.hpp b/glm/ext/vec1.hpp index bfc33f9d..cbaf672c 100644 --- a/glm/ext/vec1.hpp +++ b/glm/ext/vec1.hpp @@ -101,7 +101,7 @@ namespace glm // -- Implicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec() GLM_DEFAULT_CTOR; GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec const& v) GLM_DEFAULT; template GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, T, P> const& v); diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index 5f0e56dc..995ec60c 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -77,7 +77,7 @@ namespace glm // -- Implicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR tquat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR tquat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat const& q) GLM_DEFAULT; template GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat const& q); diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index a5e2823a..df4a5f7e 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -85,9 +85,12 @@ namespace detail // -- Implicit basic constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) template GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat() +# ifdef GLM_FORCE_CTOR_INIT + : x(0), y(0), z(0), w(1) +# endif {} # endif diff --git a/glm/gtx/dual_quaternion.hpp b/glm/gtx/dual_quaternion.hpp index c4343e9d..55445144 100644 --- a/glm/gtx/dual_quaternion.hpp +++ b/glm/gtx/dual_quaternion.hpp @@ -56,7 +56,7 @@ namespace glm // -- Implicit basic constructors -- - GLM_FUNC_DECL GLM_CONSTEXPR tdualquat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR tdualquat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat const& d) GLM_DEFAULT; template GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat const& d); diff --git a/glm/gtx/dual_quaternion.inl b/glm/gtx/dual_quaternion.inl index 79f20800..f5c1da08 100644 --- a/glm/gtx/dual_quaternion.inl +++ b/glm/gtx/dual_quaternion.inl @@ -24,9 +24,13 @@ namespace glm // -- Implicit basic constructors -- -# if !GLM_HAS_DEFAULTED_FUNCTIONS +# if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT) template GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat() +# ifdef GLM_FORCE_CTOR_INIT + : real(tquat()) + , dual(tquat(0, 0, 0, 0)) +# endif {} # endif