Merge pull request #887 from timmmeh/master

'if constexpr' warning (c++17) #887
This commit is contained in:
Christophe
2019-04-01 17:00:59 +02:00
committed by GitHub
3 changed files with 26 additions and 5 deletions

View File

@@ -293,6 +293,27 @@
# define GLM_CONSTEXPR
#endif
//
#if GLM_HAS_CONSTEXPR
# 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
# elif (GLM_LANG & GLM_LANG_CXX17_FLAG)
# define GLM_HAS_IF_CONSTEXPR 1
# else
# define GLM_HAS_IF_CONSTEXPR 0
# endif
#else
# define GLM_HAS_IF_CONSTEXPR 0
#endif
#if GLM_HAS_IF_CONSTEXPR
# define GLM_IF_CONSTEXPR if constexpr
#else
# define GLM_IF_CONSTEXPR if
#endif
//
#if GLM_LANG & GLM_LANG_CXX11_FLAG
# define GLM_HAS_ASSIGNABLE 1