From fd00b057da33adc66c9f959d38fb34fd643e3acd Mon Sep 17 00:00:00 2001 From: Cort Stratton Date: Tue, 9 Oct 2018 13:12:01 +0200 Subject: [PATCH 1/3] Add message when GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined and enabled --- glm/detail/setup.hpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 63c529b4..e4fc75aa 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -1035,9 +1035,13 @@ namespace detail # pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions") # endif -# if defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE) -# undef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES -# pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions") +# if defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES) +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE +# undef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES +# pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions.") +# elif GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE +# pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined. All gentypes (e.g. vec3) will be aligned and padded by default.") +# endif # endif # if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT From 7d527af1ecf29dfaee2a94b92c3531186bcc87ed Mon Sep 17 00:00:00 2001 From: Cort Stratton Date: Tue, 9 Oct 2018 13:12:24 +0200 Subject: [PATCH 2/3] Minor formatting changes for existing messages (add trailing periods) --- glm/detail/setup.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index e4fc75aa..84ebb6f8 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -992,12 +992,12 @@ namespace detail // Report whether only xyzw component are used # if defined GLM_FORCE_XYZW_ONLY -# pragma message("GLM: GLM_FORCE_XYZW_ONLY is defined. Only x, y, z and w component are available in vector type. This define disables swizzle operators and SIMD instruction sets") +# pragma message("GLM: GLM_FORCE_XYZW_ONLY is defined. Only x, y, z and w component are available in vector type. This define disables swizzle operators and SIMD instruction sets.") # endif // Report swizzle operator support # if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR -# pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling operators enabled") +# pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling operators enabled.") # elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION # pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling functions enabled. Enable compiler C++ language extensions to enable swizzle operators.") # else @@ -1024,7 +1024,7 @@ namespace detail # endif # ifdef GLM_FORCE_SINGLE_ONLY -# pragma message("GLM: GLM_FORCE_SINGLE_ONLY is defined. Using only single precision floating-point types") +# pragma message("GLM: GLM_FORCE_SINGLE_ONLY is defined. Using only single precision floating-point types.") # endif # if defined(GLM_FORCE_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE) @@ -1032,7 +1032,7 @@ namespace detail # pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined, allowing aligned types. This prevents the use of C++ constexpr.") # elif defined(GLM_FORCE_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE) # undef GLM_FORCE_ALIGNED_GENTYPES -# pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions") +# pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions.") # endif # if defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES) From eaca81874f754edb34c926a360be97d53754030f Mon Sep 17 00:00:00 2001 From: Cort Stratton Date: Tue, 9 Oct 2018 13:13:39 +0200 Subject: [PATCH 3/3] Suppress struct-padding warning on vec3s with GLM_CONFIG_ALIGNED_GENTYPES + GLM_CONFIG_SILENT_WARNINGS --- glm/detail/type_vec3.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/glm/detail/type_vec3.hpp b/glm/detail/type_vec3.hpp index a7962309..d83cde67 100644 --- a/glm/detail/type_vec3.hpp +++ b/glm/detail/type_vec3.hpp @@ -35,6 +35,9 @@ namespace glm # elif GLM_COMPILER & GLM_COMPILER_VC # pragma warning(push) # pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE +# pragma warning(disable: 4324) // structure was padded due to alignment specifier +# endif # endif # endif