浏览代码

Fixed infinite loop in isfinite function with GCC #221

Christophe Riccio 11 年之前
父节点
当前提交
96ef6ae9ba
共有 2 个文件被更改,包括 4 次插入1 次删除
  1. 3 1
      glm/gtx/compatibility.inl
  2. 1 0
      readme.txt

+ 3 - 1
glm/gtx/compatibility.inl

@@ -7,6 +7,8 @@
 // File    : glm/gtx/compatibility.inl
 // File    : glm/gtx/compatibility.inl
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 
+#include <limits>
+
 namespace glm
 namespace glm
 {
 {
 	// isfinite
 	// isfinite
@@ -21,7 +23,7 @@ namespace glm
 #		elif(GLM_COMPILER & GLM_COMPILER_GCC && GLM_PLATFORM & GLM_PLATFORM_ANDROID)
 #		elif(GLM_COMPILER & GLM_COMPILER_GCC && GLM_PLATFORM & GLM_PLATFORM_ANDROID)
 			return _isfinite(x) != 0;
 			return _isfinite(x) != 0;
 #		else
 #		else
-			return isfinite(x) != 0;
+			return x >= std::numeric_limits<genType>::min() && x <= std::numeric_limits<genType>::max();
 #		endif
 #		endif
 	}
 	}
 
 

+ 1 - 0
readme.txt

@@ -42,6 +42,7 @@ GLM 0.9.5.5: 2014-XX-XX
 - Fixed std::nextafter not supported with C++11 on Android #213
 - Fixed std::nextafter not supported with C++11 on Android #213
 - Fixed missing value_type for dual quaternion
 - Fixed missing value_type for dual quaternion
 - Fixed return type of dual quaternion length
 - Fixed return type of dual quaternion length
+- Fixed infinite loop in isfinite function with GCC #221
 
 
 ================================================================================
 ================================================================================
 GLM 0.9.5.4: 2014-06-21
 GLM 0.9.5.4: 2014-06-21