Skip to content

Commit

Permalink
Merge pull request #821 from cdwfs/silent-padding-warning
Browse files Browse the repository at this point in the history
Suppress warning on aligned vec3 when GLM_FORCE_SILENT_WARNINGS is used. Fixes #822 #821
  • Loading branch information
Groovounet authored Oct 16, 2018
2 parents 6f6f4d3 + eaca818 commit b8ee874
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
18 changes: 11 additions & 7 deletions glm/detail/setup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -1024,20 +1024,24 @@ 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)
# undef GLM_FORCE_ALIGNED_GENTYPES
# 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
Expand Down
3 changes: 3 additions & 0 deletions glm/detail/type_vec3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b8ee874

Please # to comment.