From 81dfda4cf319f9ea460ac7412d07f164aeb414fd Mon Sep 17 00:00:00 2001 From: Jonas Karlsson Date: Wed, 3 Jul 2019 09:41:29 +0200 Subject: [PATCH] Fix gcc if constexpr error Check against __cplusplus version instead of compiler version. This fixes compilation errors when using an older cpp standard version with a newer gcc compiler. This flag requires GCC 4.7 or greater. --- glm/detail/setup.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 1eae6a22..f34832ba 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -298,7 +298,7 @@ # if (GLM_COMPILER & GLM_COMPILER_CLANG) # define GLM_HAS_IF_CONSTEXPR __has_feature(cxx_if_constexpr) # elif (GLM_COMPILER & GLM_COMPILER_GCC) -# define GLM_HAS_IF_CONSTEXPR GLM_COMPILER >= GLM_COMPILER_GCC7 +# define GLM_HAS_IF_CONSTEXPR (__cplusplus >= 201703L) # elif (GLM_LANG & GLM_LANG_CXX17_FLAG) # define GLM_HAS_IF_CONSTEXPR 1 # else