From a539e221852ccf7787499ac3af34d803cef35131 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 19 Jan 2011 15:44:05 +0000 Subject: [PATCH] Improved platform detection --- glm/ext.hpp | 5 +++++ glm/setup.hpp | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/glm/ext.hpp b/glm/ext.hpp index b44b60fe..107406c7 100644 --- a/glm/ext.hpp +++ b/glm/ext.hpp @@ -10,6 +10,11 @@ #ifndef glm_ext #define glm_ext +#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_EXT_INCLUDED_DISPLAYED)) +# define GLM_MESSAGE_EXT_INCLUDED_DISPLAYED +# pragma message("GLM: All extensions included (not recommanded)") +#endif//GLM_MESSAGE + #include "./gtc/half_float.hpp" #include "./gtc/matrix_access.hpp" #include "./gtc/matrix_inverse.hpp" diff --git a/glm/setup.hpp b/glm/setup.hpp index 255eb04f..5c1868ef 100644 --- a/glm/setup.hpp +++ b/glm/setup.hpp @@ -79,6 +79,9 @@ #define GLM_COMPILER_GCC49 0x02000100 #define GLM_COMPILER_GCC50 0x02000200 +// G++ command line to display defined +// echo "" | g++ -E -dM -x c++ - | sort + // Borland C++ defines. How to identify BC? #define GLM_COMPILER_BC 0x03000000 #define GLM_COMPILER_BCB4 0x03000100 @@ -209,7 +212,7 @@ # define GLM_MODEL GLM_MODEL_32 # endif//_M_X64 #elif(GLM_COMPILER & GLM_COMPILER_GCC) -# if(defined(__WORDSIZE) && (__WORDSIZE == 64)) || defined(__arch64__) || defined(__LP64__) +# if(defined(__WORDSIZE) && (__WORDSIZE == 64)) || defined(__arch64__) || defined(__LP64__) || defined(__x86_64__) # define GLM_MODEL GLM_MODEL_64 # else # define GLM_MODEL GLM_MODEL_32 @@ -269,14 +272,14 @@ # else # define GLM_SUPPORT GLM_SUPPORT_SSE3 # endif -# elif(GLM_COMPILER >= GLM_COMPILER_VC2008) +# elif(GLM_COMPILER >= GLM_COMPILER_VC2008) # define GLM_SUPPORT GLM_SUPPORT_SSE3 # elif(GLM_COMPILER >= GLM_COMPILER_VC2005) # define GLM_SUPPORT GLM_SUPPORT_SSE2 # else # define GLM_SUPPORT GLM_SUPPORT_PURE # endif -#elif(GLM_COMPILER & GLM_COMPILER_GCC) +#elif((GLM_COMPILER & GLM_COMPILER_GCC) && (defined(__i386__) || defined(__x86_64__))) # if(GLM_COMPILER >= GLM_COMPILER_GCC44) # define GLM_SUPPORT GLM_SUPPORT_AVX # elif(GLM_COMPILER >= GLM_COMPILER_GCC40)