From 6e82d7ba3156f36bb6bdf2eb5d157add7eef4901 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Tue, 27 Aug 2013 11:05:06 +0200 Subject: [PATCH] Remove unsupported compiler detection --- glm/core/setup.hpp | 68 ++++++++++++-------------------- glm/gtc/type_ptr.inl | 19 ++------- readme.txt | 1 + test/core/core_setup_message.cpp | 52 ++++++------------------ 4 files changed, 41 insertions(+), 99 deletions(-) diff --git a/glm/core/setup.hpp b/glm/core/setup.hpp index b6214806..01d4525e 100644 --- a/glm/core/setup.hpp +++ b/glm/core/setup.hpp @@ -125,26 +125,16 @@ // Visual C++ defines #define GLM_COMPILER_VC 0x01000000 -#define GLM_COMPILER_VC2 0x01000010 -#define GLM_COMPILER_VC4 0x01000020 -#define GLM_COMPILER_VC5 0x01000030 -#define GLM_COMPILER_VC6 0x01000040 -#define GLM_COMPILER_VC2002 0x01000050 -#define GLM_COMPILER_VC2003 0x01000060 -#define GLM_COMPILER_VC2005 0x01000070 -#define GLM_COMPILER_VC2008 0x01000080 -#define GLM_COMPILER_VC2010 0x01000090 -#define GLM_COMPILER_VC2012 0x010000A0 -#define GLM_COMPILER_VC2013 0x010000B0 +#define GLM_COMPILER_VC8 0x01000070 +#define GLM_COMPILER_VC9 0x01000080 +#define GLM_COMPILER_VC10 0x01000090 +#define GLM_COMPILER_VC11 0x010000A0 +#define GLM_COMPILER_VC12 0x010000B0 // GCC defines #define GLM_COMPILER_GCC 0x02000000 #define GLM_COMPILER_GCC_LLVM 0x02000001 #define GLM_COMPILER_GCC_CLANG 0x02000002 -#define GLM_COMPILER_GCC30 0x02000010 -#define GLM_COMPILER_GCC31 0x02000020 -#define GLM_COMPILER_GCC32 0x02000030 -#define GLM_COMPILER_GCC33 0x02000040 #define GLM_COMPILER_GCC34 0x02000050 #define GLM_COMPILER_GCC35 0x02000060 #define GLM_COMPILER_GCC40 0x02000070 @@ -158,16 +148,8 @@ #define GLM_COMPILER_GCC48 0x020000F0 #define GLM_COMPILER_GCC49 0x02000100 -// G++ command line to display defined -// echo "" | g++ -E -dM -x c++ - | sort - -// Borland C++ defines. How to identify BC? +// Borland C++ #define GLM_COMPILER_BC 0x04000000 -#define GLM_COMPILER_BCB4 0x04000100 -#define GLM_COMPILER_BCB5 0x04000200 -#define GLM_COMPILER_BCB6 0x04000300 -//#define GLM_COMPILER_BCBX 0x04000400 // What's the version value? -#define GLM_COMPILER_BCB2009 0x04000500 // CodeWarrior #define GLM_COMPILER_CODEWARRIOR 0x08000000 @@ -241,15 +223,15 @@ # if _MSC_VER < 1400 # error "GLM requires Visual C++ 2005 or higher" # elif _MSC_VER == 1400 -# define GLM_COMPILER GLM_COMPILER_VC2005 +# define GLM_COMPILER GLM_COMPILER_VC8 # elif _MSC_VER == 1500 -# define GLM_COMPILER GLM_COMPILER_VC2008 +# define GLM_COMPILER GLM_COMPILER_VC9 # elif _MSC_VER == 1600 -# define GLM_COMPILER GLM_COMPILER_VC2010 +# define GLM_COMPILER GLM_COMPILER_VC10 # elif _MSC_VER == 1700 -# define GLM_COMPILER GLM_COMPILER_VC2012 +# define GLM_COMPILER GLM_COMPILER_VC11 # elif _MSC_VER >= 1800 -# define GLM_COMPILER GLM_COMPILER_VC2013 +# define GLM_COMPILER GLM_COMPILER_VC12 # else//_MSC_VER # define GLM_COMPILER GLM_COMPILER_VC # endif//_MSC_VER @@ -290,11 +272,7 @@ // G++ #elif(defined(__GNUC__) || defined(__MINGW32__))// || defined(__llvm__) || defined(__clang__) -# if (__GNUC__ == 3) && (__GNUC_MINOR__ == 2) -# define GLM_COMPILER GLM_COMPILER_GCC32 -# elif (__GNUC__ == 3) && (__GNUC_MINOR__ == 3) -# define GLM_COMPILER GLM_COMPILER_GCC33 -# elif (__GNUC__ == 3) && (__GNUC_MINOR__ == 4) +# if (__GNUC__ == 3) && (__GNUC_MINOR__ == 4) # define GLM_COMPILER GLM_COMPILER_GCC34 # elif (__GNUC__ == 3) && (__GNUC_MINOR__ == 5) # define GLM_COMPILER GLM_COMPILER_GCC35 @@ -404,18 +382,22 @@ #define GLM_LANG_CXX03_FLAG (1 << 2) #define GLM_LANG_CXX0X_FLAG (1 << 3) #define GLM_LANG_CXX11_FLAG (1 << 4) -#define GLM_LANG_CXXMS_FLAG (1 << 5) -#define GLM_LANG_CXXGNU_FLAG (1 << 6) +#define GLM_LANG_CXX1Y_FLAG (1 << 5) +#define GLM_LANG_CXXMS_FLAG (1 << 6) +#define GLM_LANG_CXXGNU_FLAG (1 << 7) #define GLM_LANG_CXX GLM_LANG_CXX_FLAG #define GLM_LANG_CXX98 (GLM_LANG_CXX | GLM_LANG_CXX98_FLAG) #define GLM_LANG_CXX03 (GLM_LANG_CXX98 | GLM_LANG_CXX03_FLAG) #define GLM_LANG_CXX0X (GLM_LANG_CXX03 | GLM_LANG_CXX0X_FLAG) #define GLM_LANG_CXX11 (GLM_LANG_CXX0X | GLM_LANG_CXX11_FLAG) +#define GLM_LANG_CXX1Y (GLM_LANG_CXX11 | GLM_LANG_CXX1Y_FLAG) #define GLM_LANG_CXXMS GLM_LANG_CXXMS_FLAG #define GLM_LANG_CXXGNU GLM_LANG_CXXGNU_FLAG -#if(defined(GLM_FORCE_CXX11)) +#if(defined(GLM_FORCE_CXX1Y)) +# define GLM_LANG GLM_LANG_CXX1Y +#elif(defined(GLM_FORCE_CXX11)) # define GLM_LANG GLM_LANG_CXX11 #elif(defined(GLM_FORCE_CXX03)) # define GLM_LANG GLM_LANG_CXX03 @@ -445,13 +427,13 @@ # endif # elif(GLM_COMPILER & GLM_COMPILER_VC) # if(defined(_MSC_EXTENSIONS)) -# if(GLM_COMPILER >= GLM_COMPILER_VC2010) +# if(GLM_COMPILER >= GLM_COMPILER_VC10) # define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_CXXMS_FLAG) # else # define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_CXXMS_FLAG) # endif # else -# if(GLM_COMPILER >= GLM_COMPILER_VC2010) +# if(GLM_COMPILER >= GLM_COMPILER_VC10) # define GLM_LANG GLM_LANG_CXX0X # else # define GLM_LANG GLM_LANG_CXX98 @@ -536,17 +518,17 @@ # define GLM_ARCH GLM_ARCH_PURE # endif */ -# elif(GLM_COMPILER >= GLM_COMPILER_VC2012) +# elif(GLM_COMPILER >= GLM_COMPILER_VC11) # define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif(GLM_COMPILER >= GLM_COMPILER_VC2010) +# elif(GLM_COMPILER >= GLM_COMPILER_VC10) # if(_MSC_FULL_VER >= 160031118) //160031118: VC2010 SP1 beta full version # define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)//GLM_ARCH_AVX (Require SP1) # else # define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2) # endif -# elif(GLM_COMPILER >= GLM_COMPILER_VC2008) +# elif(GLM_COMPILER >= GLM_COMPILER_VC9) # define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2) -# elif(GLM_COMPILER >= GLM_COMPILER_VC2005) +# elif(GLM_COMPILER >= GLM_COMPILER_VC8) # define GLM_ARCH GLM_ARCH_SSE2 # else # define GLM_ARCH GLM_ARCH_PURE diff --git a/glm/gtc/type_ptr.inl b/glm/gtc/type_ptr.inl index 6b3e1ac0..df4890ec 100644 --- a/glm/gtc/type_ptr.inl +++ b/glm/gtc/type_ptr.inl @@ -286,23 +286,12 @@ namespace glm //! Return the address to the data of the matrix input. /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T * value_ptr(detail::tmat4x3 & mat) + template + GLM_FUNC_QUALIFIER T * value_ptr(detail::tmat4x3 & mat) { return &(mat[0].x); } - /// Return the constant address to the data of the quaternion input. - /// @see gtc_type_ptr - template - GLM_FUNC_QUALIFIER T * value_ptr - ( - detail::tquat & q - ) - { - return &(q[0]); - } - //! Return the constant address to the data of the input parameter. /// @see gtc_type_ptr template @@ -316,10 +305,10 @@ namespace glm //! Return the address to the data of the quaternion input. /// @see gtc_type_ptr - template + template GLM_FUNC_QUALIFIER T * value_ptr ( - detail::tquat & q + detail::tquat & q ) { return &(q[0]); diff --git a/readme.txt b/readme.txt index 74bcd8e5..c4581aec 100644 --- a/readme.txt +++ b/readme.txt @@ -51,6 +51,7 @@ GLM 0.9.5.0: 2013-XX-XX - Removed GTX_ocl_type extension - Fixed post increment and decrement operators - Fixed perspective with zNear == 0 (#71) +- Clean up compiler detection code for unsupported compilers ================================================================================ GLM 0.9.4.6: 2013-08-XX diff --git a/test/core/core_setup_message.cpp b/test/core/core_setup_message.cpp index 71b0a61f..12cda909 100644 --- a/test/core/core_setup_message.cpp +++ b/test/core/core_setup_message.cpp @@ -2,7 +2,7 @@ // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2011-05-31 -// Updated : 2011-05-31 +// Updated : 2013-08-27 // Licence : This source is under MIT License // File : test/core/setup_message.cpp /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -21,38 +21,20 @@ int test_compiler() switch(GLM_COMPILER) { - case GLM_COMPILER_VC2: - std::cout << "GLM_COMPILER_VC2" << std::endl; + case GLM_COMPILER_VC8: + std::cout << "GLM_COMPILER_VC8" << std::endl; break; - case GLM_COMPILER_VC4: - std::cout << "GLM_COMPILER_VC4" << std::endl; + case GLM_COMPILER_VC9: + std::cout << "GLM_COMPILER_VC9" << std::endl; break; - case GLM_COMPILER_VC5: - std::cout << "GLM_COMPILER_VC5" << std::endl; + case GLM_COMPILER_VC10: + std::cout << "GLM_COMPILER_VC10" << std::endl; break; - case GLM_COMPILER_VC6: - std::cout << "GLM_COMPILER_VC6" << std::endl; + case GLM_COMPILER_VC11: + std::cout << "GLM_COMPILER_VC11" << std::endl; break; - case GLM_COMPILER_VC2002: - std::cout << "GLM_COMPILER_VC2002" << std::endl; - break; - case GLM_COMPILER_VC2003: - std::cout << "GLM_COMPILER_VC2003" << std::endl; - break; - case GLM_COMPILER_VC2005: - std::cout << "GLM_COMPILER_VC2005" << std::endl; - break; - case GLM_COMPILER_VC2008: - std::cout << "GLM_COMPILER_VC2008" << std::endl; - break; - case GLM_COMPILER_VC2010: - std::cout << "GLM_COMPILER_VC2010" << std::endl; - break; - case GLM_COMPILER_VC2012: - std::cout << "GLM_COMPILER_VC2012" << std::endl; - break; - case GLM_COMPILER_VC2013: - std::cout << "GLM_COMPILER_VC2013" << std::endl; + case GLM_COMPILER_VC12: + std::cout << "GLM_COMPILER_VC12" << std::endl; break; default: std::cout << "Visual C++ version not detected" << std::endl; @@ -66,18 +48,6 @@ int test_compiler() switch(GLM_COMPILER) { - case GLM_COMPILER_GCC30: - std::cout << "GLM_COMPILER_GCC30" << std::endl; - break; - case GLM_COMPILER_GCC31: - std::cout << "GLM_COMPILER_GCC31" << std::endl; - break; - case GLM_COMPILER_GCC32: - std::cout << "GLM_COMPILER_GCC32" << std::endl; - break; - case GLM_COMPILER_GCC33: - std::cout << "GLM_COMPILER_GCC33" << std::endl; - break; case GLM_COMPILER_GCC34: std::cout << "GLM_COMPILER_GCC34" << std::endl; break;