---------- Forwarded message ----------
From: Andrew Caudwell <acaudw...@gmail.com>
Date: Thu, Mar 29, 2018 at 11:55 AM
Subject: Re: Bug#892861: libglm-dev: removal of default type initialization
breaking packages
To: Guus Sliepen <g...@debian.org>



On Thu, Mar 29, 2018 at 9:12 AM, Guus Sliepen <g...@debian.org> wrote:

> tags 892861 - wontfix
> thanks
>
> On Wed, Mar 28, 2018 at 01:19:44PM +1300, Andrew Caudwell wrote:
>
> > Upstream has implemented my suggestion to re-add default initialization
> as
> > opt-in via a new define:
> >
> > https://github.com/g-truc/glm/issues/735
> > https://github.com/g-truc/glm/commit/8390a77b3a278b15259e5ca
> 6e67f7e41badc457b
> >
> > Could you apply the commit as a patch so maintainers can then define
> > GLM_FORCE_CTOR_INIT and avoid having to modifying code?
>
> Sure. However, I'm running into problems trying to apply the patch: it
> doesn't apply cleanly on 0.9.9~a2, and if I just package the latest
> revision from git, then I am getting internal compiler errors from GCC.
> I can still compile 0.9.9~a2 without problems, so I will try to see if I
> can just adapt the commit which adds GLM_FORCE_CTOR_INIT to 0.9.9~a2.
>
> Here's a patch I created. The main issue is they added a few macros before
the constructors that we need to remove:

git format-patch -1 8390a77b3a278b15259e5ca6e67f7e41badc457b
perl -npe "s/GLM_CONSTEXPR_(CTOR_)?CXX14 //g"
0001-Added-GLM_FORCE_CTOR_INIT-735-740.patch
> 0001-Added-GLM_FORCE_CTOR_INIT-735-740-fixed.patch

I also had to remove some expected white space from type_mat3x2.inl and
type_mat4x2.inl.

Tested it against the 0.9.9-a2 tag with GLM_FORCE_CTOR_INIT defined and it
fixes my issue.



> > Let me know as then I can then avoid having to embed the current release
> in
> > my software.
>
> Yeah, that would be less than optimal.
>
> --
> Met vriendelijke groet / with kind regards,
>       Guus Sliepen <g...@debian.org>
>
From 8390a77b3a278b15259e5ca6e67f7e41badc457b Mon Sep 17 00:00:00 2001
From: Christophe Riccio <christophe.ric...@unity3d.com>
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 mat() GLM_DEFAULT;
+		GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL mat(mat<2, 2, T, Q> const& m) GLM_DEFAULT;
 		template<qualifier P>
 		GLM_FUNC_DECL 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<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER 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 mat() GLM_DEFAULT;
+		GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL mat(mat<2, 3, T, Q> const& m) GLM_DEFAULT;
 		template<qualifier P>
 		GLM_FUNC_DECL 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<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER 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 mat() GLM_DEFAULT;
+		GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL mat(mat<2, 4, T, Q> const& m) GLM_DEFAULT;
 		template<qualifier P>
 		GLM_FUNC_DECL 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<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER 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 mat() GLM_DEFAULT;
+		GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL mat(mat<3, 2, T, Q> const& m) GLM_DEFAULT;
 		template<qualifier P>
 		GLM_FUNC_DECL 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<typename T, qualifier Q> 
 		GLM_FUNC_QUALIFIER 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 mat() GLM_DEFAULT;
+		GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL mat(mat<3, 3, T, Q> const& m) GLM_DEFAULT;
 		template<qualifier P>
 		GLM_FUNC_DECL 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<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER 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 mat() GLM_DEFAULT;
+		GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL mat(mat<3, 4, T, Q> const& m) GLM_DEFAULT;
 		template<qualifier P>
 		GLM_FUNC_DECL 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<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER 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 mat() GLM_DEFAULT;
+		GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL mat(mat<4, 2, T, Q> const& m) GLM_DEFAULT;
 		template<qualifier P>
 		GLM_FUNC_DECL 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<typename T, qualifier Q> 
 		GLM_FUNC_QUALIFIER 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 mat() GLM_DEFAULT;
+		GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL mat(mat<4, 3, T, Q> const& m) GLM_DEFAULT;
 		template<qualifier P>
 		GLM_FUNC_DECL 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<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER 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 mat() GLM_DEFAULT;
+		GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
 		GLM_FUNC_DECL mat(mat<4, 4, T, Q> const& m) GLM_DEFAULT;
 		template<qualifier P>
 		GLM_FUNC_DECL 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<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER 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<typename T, qualifier Q>
 		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<typename T, qualifier Q>
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<qualifier P>
 		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<typename T, qualifier Q>
 		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<typename T, qualifier Q>
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<qualifier P>
 		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<typename T, qualifier Q>
 		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<typename T, qualifier Q>
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<qualifier P>
 		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<typename T, qualifier Q>
 		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<typename T, qualifier Q>
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<qualifier P>
 		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<T, Q> const& q) GLM_DEFAULT;
 		template<qualifier P>
 		GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat<T, P> 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<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, Q>::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<T, Q> const& d) GLM_DEFAULT;
 		template<qualifier P>
 		GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat<T, P> 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<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat<T, Q>::tdualquat()
+#			ifdef GLM_FORCE_CTOR_INIT
+			: real(tquat<T, P>())
+			, dual(tquat<T, P>(0, 0, 0, 0))
+#			endif
 		{}
 #	endif
 
-- 
2.16.2

-- 
debian-science-maintainers mailing list
debian-science-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-science-maintainers

Reply via email to