Added GLM_FORCE_ALIGNED_GENTYPES to enable aligned types and SIMD instruction are not enabled. This disable constexpr #816

This commit is contained in:
Christophe Riccio
2018-09-30 21:52:09 +02:00
parent 68c7e7e50b
commit 3d26f49775
6 changed files with 66 additions and 37 deletions

View File

@@ -723,6 +723,15 @@ namespace detail
# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INIT_DISABLE
#endif
///////////////////////////////////////////////////////////////////////////////////
// Use SIMD instruction sets
#if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT)
# define GLM_CONFIG_SIMD GLM_ENABLE
#else
# define GLM_CONFIG_SIMD GLM_DISABLE
#endif
///////////////////////////////////////////////////////////////////////////////////
// Configure the use of defaulted function
@@ -741,21 +750,16 @@ namespace detail
# define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
#endif
#if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG)
#ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
# define GLM_FORCE_ALIGNED_GENTYPES
#endif
#if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (defined(GLM_FORCE_ALIGNED_GENTYPES) || (GLM_CONFIG_SIMD == GLM_ENABLE))
# define GLM_CONFIG_ALIGNED_GENTYPES GLM_ENABLE
#else
# define GLM_CONFIG_ALIGNED_GENTYPES GLM_DISABLE
#endif
///////////////////////////////////////////////////////////////////////////////////
// Use SIMD instruction sets
#if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT)
# define GLM_CONFIG_SIMD GLM_ENABLE
#else
# define GLM_CONFIG_SIMD GLM_DISABLE
#endif
///////////////////////////////////////////////////////////////////////////////////
// Configure the use of anonymous structure as implementation detail
@@ -1023,6 +1027,14 @@ namespace detail
# 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")
# 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")