Skip to content

Commit

Permalink
Redesigned constexpr support which excludes both SIMD and constexpr #783
Browse files Browse the repository at this point in the history
  • Loading branch information
Groove committed Jul 9, 2018
1 parent e264f3f commit 65f1fb2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions glm/detail/setup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,17 +428,17 @@
#endif

// N2235 Generalized Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf
#if GLM_COMPILER & GLM_COMPILER_CLANG
#if (GLM_COMPILER & GLM_COMPILER_CLANG) && (GLM_ARCH == GLM_ARCH_PURE)
# define GLM_HAS_CONSTEXPR_CXX11 __has_feature(cxx_constexpr)
#elif GLM_LANG & GLM_LANG_CXX11_FLAG
#elif (GLM_LANG & GLM_LANG_CXX11_FLAG) && (GLM_ARCH == GLM_ARCH_PURE)
# define GLM_HAS_CONSTEXPR_CXX11 1
#else
// GCC 4.6 support constexpr but there is a compiler bug causing a crash
// Visual C++ has a bug #594 https://github.com/g-truc/glm/issues/594
# define GLM_HAS_CONSTEXPR_CXX11 ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48) && (GLM_ARCH == GLM_ARCH_PURE)) || \
# define GLM_HAS_CONSTEXPR_CXX11 ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_ARCH == GLM_ARCH_PURE) && (\
((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48)) || \
((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14) && (GLM_ARCH == GLM_ARCH_PURE))))
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14))))
#endif

#if GLM_HAS_CONSTEXPR_CXX11
Expand All @@ -448,15 +448,15 @@
#endif

// N3652 Extended Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html
#if GLM_COMPILER & GLM_COMPILER_CLANG
#if (GLM_COMPILER & GLM_COMPILER_CLANG) && (GLM_ARCH == GLM_ARCH_PURE)
# define GLM_HAS_CONSTEXPR_CXX14 __has_feature(cxx_relaxed_constexpr)
#elif GLM_LANG & GLM_LANG_CXX14_FLAG
#elif (GLM_LANG & GLM_LANG_CXX14_FLAG) && (GLM_ARCH == GLM_ARCH_PURE)
# define GLM_HAS_CONSTEXPR_CXX14 1
#else
# define GLM_HAS_CONSTEXPR_CXX14 ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC50) && (GLM_ARCH == GLM_ARCH_PURE)) || \
((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL17) && (GLM_ARCH == GLM_ARCH_PURE)) || \
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15) && (GLM_ARCH == GLM_ARCH_PURE))))
# define GLM_HAS_CONSTEXPR_CXX14 ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_ARCH == GLM_ARCH_PURE) && (\
((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC50)) || \
((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL17)) || \
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15))))
#endif

#if GLM_HAS_CONSTEXPR_CXX14
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ glm::mat4 camera(float Translate, glm::vec2 const& Rotate)
#### Improvements:
- Added missing vec1 based constructors
- Redesigned constexpr support which supports both SIMD and constexpr on Clang #783
- Redesigned constexpr support which excludes both SIMD and constexpr #783
- Added detection of Visual C++ 2017 toolsets
#### Fixes:
Expand Down

0 comments on commit 65f1fb2

Please sign in to comment.