Browse Source

Merge branch '0.9.4' of https://github.com/g-truc/glm into 0.9.4

Christophe Riccio 13 years ago
parent
commit
b78d53d0ac
3 changed files with 10 additions and 3 deletions
  1. 1 1
      glm/core/intrinsic_common.inl
  2. 7 0
      glm/core/setup.hpp
  3. 2 2
      glm/gtx/simd_mat4.inl

+ 1 - 1
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<int>(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));

+ 7 - 0
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 <intrin.h>
+#endif
+
 //#if(GLM_ARCH != GLM_ARCH_PURE)
 #if(GLM_ARCH & GLM_ARCH_AVX2)
 #	include <immintrin.h>

+ 2 - 2
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];