Browse Source

Fixed scalar uaddCarry build error with Cuda #276

Christophe Riccio 11 years ago
parent
commit
28aba540ee
2 changed files with 7 additions and 1 deletions
  1. 1 1
      glm/detail/func_integer.inl
  2. 6 0
      readme.txt

+ 1 - 1
glm/detail/func_integer.inl

@@ -203,7 +203,7 @@ namespace detail
 	GLM_FUNC_QUALIFIER uint uaddCarry(uint const & x, uint const & y, uint & Carry)
 	GLM_FUNC_QUALIFIER uint uaddCarry(uint const & x, uint const & y, uint & Carry)
 	{
 	{
 		uint64 const Value64(static_cast<uint64>(x) + static_cast<uint64>(y));
 		uint64 const Value64(static_cast<uint64>(x) + static_cast<uint64>(y));
-		uint64 const Max32(static_cast<uint64>(std::numeric_limits<uint>::max()));
+		uint64 const Max32((static_cast<uint64>(1) << static_cast<uint64>(32)) - static_cast<uint64>(1));
 		Carry = Value64 > Max32 ? 1 : 0;
 		Carry = Value64 > Max32 ? 1 : 0;
 		return static_cast<uint32>(Value64 % (Max32 + static_cast<uint64>(1)));
 		return static_cast<uint32>(Value64 % (Max32 + static_cast<uint64>(1)));
 	}
 	}

+ 6 - 0
readme.txt

@@ -62,6 +62,12 @@ GLM is a header only library, there is nothing to build, just include it.
 More informations in GLM manual:
 More informations in GLM manual:
 http://glm.g-truc.net/glm.pdf
 http://glm.g-truc.net/glm.pdf
 
 
+================================================================================
+GLM 0.9.6.1: 2014-12-XX
+--------------------------------------------------------------------------------
+Fixes:
+- Fixed uaddCarry error for Cuda build #276
+
 ================================================================================
 ================================================================================
 GLM 0.9.6.0: 2014-11-30
 GLM 0.9.6.0: 2014-11-30
 --------------------------------------------------------------------------------
 --------------------------------------------------------------------------------