Browse Source

Clean up configuration defines

Christophe Riccio 7 years ago
parent
commit
b6321cb85e

+ 1 - 1
glm/detail/func_common.inl

@@ -781,6 +781,6 @@ namespace detail
 	}
 }//namespace glm
 
-#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
+#if GLM_USE_SIMD == GLM_ENABLE
 #	include "func_common_simd.inl"
 #endif

+ 1 - 1
glm/detail/func_exponential.inl

@@ -146,7 +146,7 @@ namespace detail
 	}
 }//namespace glm
 
-#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
+#if GLM_USE_SIMD == GLM_ENABLE
 #	include "func_exponential_simd.inl"
 #endif
 

+ 1 - 1
glm/detail/func_geometric.inl

@@ -242,6 +242,6 @@ namespace detail
 	}
 }//namespace glm
 
-#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
+#if GLM_USE_SIMD == GLM_ENABLE
 #	include "func_geometric_simd.inl"
 #endif

+ 1 - 1
glm/detail/func_integer.inl

@@ -372,7 +372,7 @@ namespace detail
 	}
 }//namespace glm
 
-#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
+#if GLM_USE_SIMD == GLM_ENABLE
 #	include "func_integer_simd.inl"
 #endif
 

+ 1 - 1
glm/detail/func_matrix.inl

@@ -395,7 +395,7 @@ namespace detail
 	}
 }//namespace glm
 
-#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
+#if GLM_USE_SIMD == GLM_ENABLE
 #	include "func_matrix_simd.inl"
 #endif
 

+ 1 - 1
glm/detail/func_packing.inl

@@ -184,7 +184,7 @@ namespace glm
 	}
 }//namespace glm
 
-#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
+#if GLM_USE_SIMD == GLM_ENABLE
 #	include "func_packing_simd.inl"
 #endif
 

+ 1 - 1
glm/detail/func_trigonometric.inl

@@ -194,7 +194,7 @@ namespace glm
 	}
 }//namespace glm
 
-#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
+#if GLM_USE_SIMD == GLM_ENABLE
 #	include "func_trigonometric_simd.inl"
 #endif
 

+ 1 - 1
glm/detail/func_vector_relational.inl

@@ -100,6 +100,6 @@ namespace glm
 	}
 }//namespace glm
 
-#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
+#if GLM_USE_SIMD == GLM_ENABLE
 #	include "func_vector_relational_simd.inl"
 #endif

+ 37 - 17
glm/detail/setup.hpp

@@ -564,20 +564,6 @@
 
 ///////////////////////////////////////////////////////////////////////////////////
 
-#ifdef GLM_FORCE_NO_CTOR_INIT
-#	undef GLM_FORCE_CTOR_INIT
-#endif
-
-#if GLM_HAS_DEFAULTED_FUNCTIONS && !defined(GLM_FORCE_CTOR_INIT)
-#	define GLM_USE_DEFAULTED_FUNCTIONS GLM_ENABLE
-#	define GLM_DEFAULT = default
-#else
-#	define GLM_USE_DEFAULTED_FUNCTIONS GLM_DISABLE
-#	define GLM_DEFAULT
-#endif
-
-///////////////////////////////////////////////////////////////////////////////////
-
 #ifdef GLM_FORCE_EXPLICIT_CTOR
 #	define GLM_EXPLICIT explicit
 #else
@@ -628,7 +614,32 @@ namespace glm
 #elif GLM_SETUP_INCLUDED == GLM_VERSION
 
 ///////////////////////////////////////////////////////////////////////////////////
-// Enable aligned gentypes
+// Configure the use of defaulted initialized types
+
+#define GLM_CTOR_INITIALIZER_LIST	(1 << 1)
+#define GLM_CTOR_INITIALISATION		(1 << 2)
+
+#if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
+#	define GLM_USE_CTOR_INIT GLM_CTOR_INITIALIZER_LIST
+#elif defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
+#	define GLM_USE_CTOR_INIT GLM_CTOR_INITIALISATION
+#else
+#	define GLM_USE_CTOR_INIT GLM_DISABLE
+#endif
+
+///////////////////////////////////////////////////////////////////////////////////
+// Configure the use of defaulted function
+
+#if GLM_HAS_DEFAULTED_FUNCTIONS && GLM_USE_CTOR_INIT == GLM_DISABLE
+#	define GLM_USE_DEFAULTED_FUNCTIONS GLM_ENABLE
+#	define GLM_DEFAULT = default
+#else
+#	define GLM_USE_DEFAULTED_FUNCTIONS GLM_DISABLE
+#	define GLM_DEFAULT
+#endif
+
+///////////////////////////////////////////////////////////////////////////////////
+// Configure the use of aligned gentypes
 
 #if defined(GLM_FORCE_ALIGNED_GENTYPES) && GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG)
 #	define GLM_USE_ALIGNED_GENTYPES GLM_ENABLE
@@ -637,9 +648,18 @@ namespace glm
 #endif
 
 ///////////////////////////////////////////////////////////////////////////////////
-// Implementation detail
+// Use SIMD instruction sets
+
+#if (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT)
+#define GLM_USE_SIMD GLM_ENABLE
+#else
+#define GLM_USE_SIMD GLM_DISABLE
+#endif
+
+///////////////////////////////////////////////////////////////////////////////////
+// Configure the use of anonymous structure as implementation detail
 
-#if (((GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT)) || (GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR) || (GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE))
+#if ((GLM_USE_SIMD == GLM_ENABLE) || (GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR) || (GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE))
 #	define GLM_USE_ANONYMOUS_STRUCT GLM_ENABLE
 #else
 #	define GLM_USE_ANONYMOUS_STRUCT GLM_DISABLE

+ 3 - 3
glm/detail/type_mat2x2.inl

@@ -7,14 +7,14 @@ namespace glm
 {
 	// -- Constructors --
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
+#	if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 2, T, Q>::mat()
-#			if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
+#			if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
 				: value{col_type(1, 0), col_type(0, 1)}
 #			endif
 		{
-#			if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
+#			if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION
 				this->value[0] = col_type(1, 0);
 				this->value[1] = col_type(0, 1);
 #			endif

+ 3 - 3
glm/detail/type_mat2x3.inl

@@ -5,14 +5,14 @@ namespace glm
 {
 	// -- Constructors --
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
+#	if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 3, T, Q>::mat()
-#			if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
+#			if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
 				: value{col_type(1, 0, 0), col_type(0, 1, 0)}
 #			endif
 		{
-#			if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
+#			if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION
 				this->value[0] = col_type(1, 0, 0);
 				this->value[1] = col_type(0, 1, 0);
 #			endif

+ 3 - 3
glm/detail/type_mat2x4.inl

@@ -5,14 +5,14 @@ namespace glm
 {
 	// -- Constructors --
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
+#	if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<2, 4, T, Q>::mat()
-#			if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
+#			if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
 				: value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0)}
 #			endif
 		{
-#			if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
+#			if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION
 				this->value[0] = col_type(1, 0, 0, 0);
 				this->value[1] = col_type(0, 1, 0, 0);
 #			endif

+ 3 - 3
glm/detail/type_mat3x2.inl

@@ -5,14 +5,14 @@ namespace glm
 {
 	// -- Constructors --
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
+#	if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 2, T, Q>::mat()
-#			if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
+#			if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
 				: value{col_type(1, 0), col_type(0, 1), col_type(0, 0)}
 #			endif
 		{
-#			if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
+#			if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION
 				this->value[0] = col_type(1, 0);
 				this->value[1] = col_type(0, 1);
 				this->value[2] = col_type(0, 0);

+ 4 - 4
glm/detail/type_mat3x3.inl

@@ -7,15 +7,15 @@ namespace glm
 {
 	// -- Constructors --
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
+#	if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 3, T, Q>::mat()
-#			if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
+#			if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
 				: value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1)}
 #			endif
 		{
-#			if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
-				this->value[0] = col_type(1, 0, 0);
+#			if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION
+			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

+ 3 - 3
glm/detail/type_mat3x4.inl

@@ -5,14 +5,14 @@ namespace glm
 {
 	// -- Constructors --
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
+#	if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<3, 4, T, Q>::mat()
-#			if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
+#			if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
 				: value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0)}
 #			endif
 		{
-#			if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
+#			if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION
 				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);

+ 3 - 3
glm/detail/type_mat4x2.inl

@@ -5,14 +5,14 @@ namespace glm
 {
 	// -- Constructors --
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
+#	if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 2, T, Q>::mat()
-#			if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
+#			if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
 				: value{col_type(1, 0), col_type(0, 1), col_type(0, 0), col_type(0, 0)}
 #			endif
 		{
-#			if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
+#			if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION
 				this->value[0] = col_type(1, 0);
 				this->value[1] = col_type(0, 1);
 				this->value[2] = col_type(0, 0);

+ 3 - 3
glm/detail/type_mat4x3.inl

@@ -5,14 +5,14 @@ namespace glm
 {
 	// -- Constructors --
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
+#	if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 3, T, Q>::mat()
-#			if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
+#			if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
 				: value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1), col_type(0, 0, 0)}
 #			endif
 		{
-#			if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
+#			if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION
 				this->value[0] = col_type(1, 0, 0);
 				this->value[1] = col_type(0, 1, 0);
 				this->value[2] = col_type(0, 0, 1);

+ 4 - 4
glm/detail/type_mat4x4.inl

@@ -7,14 +7,14 @@ namespace glm
 {
 	// -- Constructors --
 
-#	if !GLM_HAS_DEFAULTED_FUNCTIONS || defined(GLM_FORCE_CTOR_INIT)
+#	if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 mat<4, 4, T, Q>::mat()
-#			if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
+#			if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST
 				: value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)}
 #			endif
 		{
-#			if defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
+#			if GLM_USE_CTOR_INIT == GLM_CTOR_INITIALISATION
 				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);
@@ -704,6 +704,6 @@ namespace glm
 	}
 }//namespace glm
 
-#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
+#if GLM_USE_SIMD == GLM_ENABLE
 #	include "type_mat4x4_simd.inl"
 #endif

+ 1 - 1
glm/detail/type_vec1.inl

@@ -8,7 +8,7 @@ namespace glm
 #	if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 vec<1, T, Q>::vec()
-#			ifdef GLM_FORCE_CTOR_INIT
+#			if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE
 				: x(0)
 #			endif
 		{}

+ 1 - 1
glm/detail/type_vec2.inl

@@ -10,7 +10,7 @@ namespace glm
 #	if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 vec<2, T, Q>::vec()
-#			ifdef GLM_FORCE_CTOR_INIT
+#			if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE
 				: x(0), y(0)
 #			endif
 		{}

+ 1 - 1
glm/detail/type_vec3.inl

@@ -8,7 +8,7 @@ namespace glm
 #	if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 vec<3, T, Q>::vec()
-#			ifdef GLM_FORCE_CTOR_INIT
+#			if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE
 				: x(0), y(0), z(0)
 #			endif
 		{}

+ 2 - 2
glm/detail/type_vec4.inl

@@ -161,7 +161,7 @@ namespace detail
 #	if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 vec<4, T, Q>::vec()
-#			ifdef GLM_FORCE_CTOR_INIT
+#			if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE
 				: x(0), y(0), z(0), w(0)
 #			endif
 		{}
@@ -1142,6 +1142,6 @@ namespace detail
 	}
 }//namespace glm
 
-#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) && (GLM_HAS_ANONYMOUS_STRUCT)
+#if GLM_USE_SIMD == GLM_ENABLE
 #	include "type_vec4_simd.inl"
 #endif

+ 1 - 1
glm/gtc/quaternion.inl

@@ -87,7 +87,7 @@ namespace detail
 #	if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 tquat<T, Q>::tquat()
-#			ifdef GLM_FORCE_CTOR_INIT
+#			if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE
 			: x(0), y(0), z(0), w(1)
 #			endif
 		{}

+ 1 - 1
glm/gtx/dual_quaternion.inl

@@ -27,7 +27,7 @@ namespace glm
 #	if GLM_USE_DEFAULTED_FUNCTIONS == GLM_DISABLE
 		template<typename T, qualifier Q>
 		GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 tdualquat<T, Q>::tdualquat()
-#			ifdef GLM_FORCE_CTOR_INIT
+#			if GLM_USE_DEFAULTED_FUNCTIONS != GLM_DISABLE
 			: real(tquat<T, Q>())
 			, dual(tquat<T, Q>(0, 0, 0, 0))
 #			endif