From f206f39c3a2d7941c96f7c7ff0bc4d2253ebd935 Mon Sep 17 00:00:00 2001 From: Dave Reid Date: Fri, 21 Dec 2012 10:38:46 +1000 Subject: [PATCH 1/2] Fix MinGW compilation error. --- glm/core/setup.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/glm/core/setup.hpp b/glm/core/setup.hpp index 7c051199..a52e9de9 100644 --- a/glm/core/setup.hpp +++ b/glm/core/setup.hpp @@ -536,6 +536,13 @@ # define GLM_ARCH GLM_ARCH_PURE #endif +// With MinGW-W64, including intrinsic headers before intrin.h will produce some errors. The problem is +// that windows.h (and maybe other headers) will silently include intrin.h, which of course causes problems. +// To fix, we just explicitly include intrin.h here. +#if defined(__MINGW32__) && (GLM_ARCH != GLM_ARCH_PURE) +# include +#endif + //#if(GLM_ARCH != GLM_ARCH_PURE) #if(GLM_ARCH & GLM_ARCH_AVX2) # include From 7b6fb9f635c42b6361071c273a3cbbc44994c382 Mon Sep 17 00:00:00 2001 From: Dave Reid Date: Fri, 21 Dec 2012 10:48:10 +1000 Subject: [PATCH 2/2] Fix GCC warnings. --- glm/core/intrinsic_common.inl | 2 +- glm/gtx/simd_mat4.inl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/glm/core/intrinsic_common.inl b/glm/core/intrinsic_common.inl index 5890fc64..060239b5 100644 --- a/glm/core/intrinsic_common.inl +++ b/glm/core/intrinsic_common.inl @@ -62,7 +62,7 @@ namespace detail{ static const ieee754_QNAN absMask; static const __m128 GLM_VAR_USED abs4Mask = _mm_set_ps1(absMask.f); - static const __m128 GLM_VAR_USED _epi32_sign_mask = _mm_castsi128_ps(_mm_set1_epi32(0x80000000)); + static const __m128 GLM_VAR_USED _epi32_sign_mask = _mm_castsi128_ps(_mm_set1_epi32(static_cast(0x80000000))); //static const __m128 GLM_VAR_USED _epi32_inv_sign_mask = _mm_castsi128_ps(_mm_set1_epi32(0x7FFFFFFF)); //static const __m128 GLM_VAR_USED _epi32_mant_mask = _mm_castsi128_ps(_mm_set1_epi32(0x7F800000)); //static const __m128 GLM_VAR_USED _epi32_inv_mant_mask = _mm_castsi128_ps(_mm_set1_epi32(0x807FFFFF)); diff --git a/glm/gtx/simd_mat4.inl b/glm/gtx/simd_mat4.inl index 54d12425..d813aec6 100644 --- a/glm/gtx/simd_mat4.inl +++ b/glm/gtx/simd_mat4.inl @@ -102,7 +102,7 @@ GLM_FUNC_QUALIFIER fvec4SIMD & fmat4x4SIMD::operator[] ) { assert( - i >= fmat4x4SIMD::size_type(0) && + //i >= fmat4x4SIMD::size_type(0) && i < fmat4x4SIMD::col_size()); return this->Data[i]; @@ -114,7 +114,7 @@ GLM_FUNC_QUALIFIER fvec4SIMD const & fmat4x4SIMD::operator[] ) const { assert( - i >= fmat4x4SIMD::size_type(0) && + //i >= fmat4x4SIMD::size_type(0) && i < fmat4x4SIMD::col_size()); return this->Data[i];