Merge pull request #821 from cdwfs/silent-padding-warning

Suppress warning on aligned vec3 when GLM_FORCE_SILENT_WARNINGS is used. Fixes #822 #821
This commit is contained in:
Christophe 2018-10-17 00:46:27 +02:00 committed by GitHub
commit b8ee874742
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 7 deletions

View File

@ -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,12 +1032,16 @@ 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) && (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

View File

@ -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