Browse Source

Merge pull request #752 from tviksand/Do-not-define-GLM_CONSTEXPR_CXX14-on-older-versions-of-MSVC-as-extended-constexpr-is-not-supported-on-these-compilers-re-issue-#749

Do not define GLM_CONSTEXPR_CXX14 on MSVC < 2017 #752
Christophe 7 years ago
parent
commit
5ba45d302c
1 changed files with 5 additions and 1 deletions
  1. 5 1
      glm/detail/setup.hpp

+ 5 - 1
glm/detail/setup.hpp

@@ -754,7 +754,11 @@
 #endif
 #endif
 
 
 #if GLM_LANG >= GLM_LANG_CXX14
 #if GLM_LANG >= GLM_LANG_CXX14
-#	define GLM_CONSTEXPR_CXX14 GLM_CONSTEXPR
+#	if ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER <= GLM_COMPILER_VC14)) // Visual C++ < 2017 does not support extended const expressions https://msdn.microsoft.com/en-us/library/hh567368.aspx https://github.com/g-truc/glm/issues/749
+#		define GLM_CONSTEXPR_CXX14
+#	else
+#		define GLM_CONSTEXPR_CXX14 GLM_CONSTEXPR
+#	endif
 #	define GLM_CONSTEXPR_CTOR_CXX14 GLM_CONSTEXPR_CTOR
 #	define GLM_CONSTEXPR_CTOR_CXX14 GLM_CONSTEXPR_CTOR
 #else
 #else
 #	define GLM_CONSTEXPR_CXX14
 #	define GLM_CONSTEXPR_CXX14