From 389ca19d61af75049c3b8e78366409a4b9816a70 Mon Sep 17 00:00:00 2001 From: Dave Reid Date: Fri, 15 Feb 2013 08:32:56 +1000 Subject: [PATCH 1/2] Fix a Clang compilation error. The issue here is that GLM_DEPRECATED, GL_ALIGN, etc is being left undefined with the Clang build. --- glm/core/_detail.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/core/_detail.hpp b/glm/core/_detail.hpp index ad8f19e3..e4724d0b 100644 --- a/glm/core/_detail.hpp +++ b/glm/core/_detail.hpp @@ -452,7 +452,7 @@ namespace detail # define GLM_RESTRICT # define GLM_RESTRICT_VAR __restrict # define GLM_CONSTEXPR -#elif((GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM_GCC)) && (GLM_COMPILER >= GLM_COMPILER_GCC31)) +#elif(((GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM_GCC)) && (GLM_COMPILER >= GLM_COMPILER_GCC31)) || (GLM_COMPILER & GLM_COMPILER_CLANG)) # define GLM_DEPRECATED __attribute__((__deprecated__)) # define GLM_ALIGN(x) __attribute__((aligned(x))) # define GLM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x))) From af77fb31183f7720f8583cae1c96bf321eca3935 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Wed, 20 Feb 2013 15:46:10 +0100 Subject: [PATCH 2/2] Fixed conflict --- glm/core/_detail.hpp | 12 ++++++------ glm/core/setup.hpp | 26 ++++++++++++++------------ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/glm/core/_detail.hpp b/glm/core/_detail.hpp index e4724d0b..061c8579 100644 --- a/glm/core/_detail.hpp +++ b/glm/core/_detail.hpp @@ -446,12 +446,12 @@ namespace detail # define GLM_RESTRICT_VAR __restrict # define GLM_CONSTEXPR #elif(GLM_COMPILER & GLM_COMPILER_INTEL) -# define GLM_DEPRECATED -# define GLM_ALIGN(x) __declspec(align(x)) -# define GLM_ALIGNED_STRUCT(x) __declspec(align(x)) struct -# define GLM_RESTRICT -# define GLM_RESTRICT_VAR __restrict -# define GLM_CONSTEXPR +# define GLM_DEPRECATED +# define GLM_ALIGN(x) __declspec(align(x)) +# define GLM_ALIGNED_STRUCT(x) __declspec(align(x)) struct +# define GLM_RESTRICT +# define GLM_RESTRICT_VAR __restrict +# define GLM_CONSTEXPR #elif(((GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM_GCC)) && (GLM_COMPILER >= GLM_COMPILER_GCC31)) || (GLM_COMPILER & GLM_COMPILER_CLANG)) # define GLM_DEPRECATED __attribute__((__deprecated__)) # define GLM_ALIGN(x) __attribute__((aligned(x))) diff --git a/glm/core/setup.hpp b/glm/core/setup.hpp index ebb9f2ae..0a635800 100644 --- a/glm/core/setup.hpp +++ b/glm/core/setup.hpp @@ -649,29 +649,31 @@ // User defines: GLM_FORCE_INLINE GLM_FORCE_CUDA #if(defined(GLM_FORCE_CUDA) || (GLM_COMPILER & GLM_COMPILER_CUDA)) -# define GLM_CUDA_FUNC_DEF __device__ __host__ +# define GLM_CUDA_FUNC_DEF __device__ __host__ # define GLM_CUDA_FUNC_DECL __device__ __host__ #else -# define GLM_CUDA_FUNC_DEF +# define GLM_CUDA_FUNC_DEF # define GLM_CUDA_FUNC_DECL #endif #if GLM_COMPILER & GLM_COMPILER_GCC -#define GLM_VAR_USED __attribute__ ((unused)) +# define GLM_VAR_USED __attribute__ ((unused)) #else -#define GLM_VAR_USED +# define GLM_VAR_USED #endif #if(defined(GLM_FORCE_INLINE)) -# if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2005)) -# define GLM_INLINE __forceinline -# elif((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC34)) -# define GLM_INLINE __attribute__((always_inline)) -# else -# define GLM_INLINE inline -# endif//GLM_COMPILER +# if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2005)) +# define GLM_INLINE __forceinline +# elif((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC34)) +# define GLM_INLINE __attribute__((always_inline)) +# elif(GLM_COMPILER & GLM_COMPILER_CLANG) +# define GLM_INLINE __attribute__((always_inline)) +# else +# define GLM_INLINE inline +# endif//GLM_COMPILER #else -# define GLM_INLINE inline +# define GLM_INLINE inline #endif//defined(GLM_FORCE_INLINE) #define GLM_FUNC_DECL GLM_CUDA_FUNC_DECL