From e98ce44d850d36930cbf2e89a88570f458fb9878 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 16 Oct 2016 14:51:49 +0200 Subject: [PATCH] Added warning messages when using GLM_FORCE_CXX** but the compiler is known to not fully support the requested C++ version #555 --- glm/detail/setup.hpp | 20 ++++++++++++++------ readme.md | 2 ++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index e4308d17..8edb0d7e 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -142,16 +142,24 @@ #define GLM_LANG_CXXGNU GLM_LANG_CXXGNU_FLAG #if defined(GLM_FORCE_CXX14) -# undef GLM_FORCE_CXX11 -# undef GLM_FORCE_CXX03 -# undef GLM_FORCE_CXX98 +# if((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER <= GLM_COMPILER_GCC50)) || ((GLM_COMPILER & GLM_COMPILER_CLANG) && (GLM_COMPILER <= GLM_COMPILER_CLANG34)) +# pragma message("GLM: Using GLM_FORCE_CXX14 with a compiler that doesn't fully support C++14") +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma message("GLM: Using GLM_FORCE_CXX14 but there is no known version of Visual C++ compiler that fully supports C++14") +# elif GLM_COMPILER & GLM_COMPILER_INTEL +# pragma message("GLM: Using GLM_FORCE_CXX14 but there is no known version of ICC compiler that fully supports C++14") +# endif # define GLM_LANG GLM_LANG_CXX14 #elif defined(GLM_FORCE_CXX11) -# undef GLM_FORCE_CXX03 -# undef GLM_FORCE_CXX98 +# if((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER <= GLM_COMPILER_GCC48)) || ((GLM_COMPILER & GLM_COMPILER_CLANG) && (GLM_COMPILER <= GLM_COMPILER_CLANG33)) +# pragma message("GLM: Using GLM_FORCE_CXX11 with a compiler that doesn't fully support C++11") +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma message("GLM: Using GLM_FORCE_CXX11 but there is no known version of Visual C++ compiler that fully supports C++11") +# elif GLM_COMPILER & GLM_COMPILER_INTEL +# pragma message("GLM: Using GLM_FORCE_CXX11 but there is no known version of ICC compiler that fully supports C++11") +# endif # define GLM_LANG GLM_LANG_CXX11 #elif defined(GLM_FORCE_CXX03) -# undef GLM_FORCE_CXX98 # define GLM_LANG GLM_LANG_CXX03 #elif defined(GLM_FORCE_CXX98) # define GLM_LANG GLM_LANG_CXX98 diff --git a/readme.md b/readme.md index 64678fe7..1b62ea97 100644 --- a/readme.md +++ b/readme.md @@ -55,6 +55,8 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) ##### Improvements: - Added Visual C++ 15 detection - Added Clang 4.0 detection +- Added warning messages when using GLM_FORCE_CXX** but the compiler + is known to not fully support the requested C++ version #555 - Refactored GLM_COMPILER_VC values ##### Fixes: