Browse Source

Fixed isnan and isinf on Android

Christophe Riccio 14 years ago
parent
commit
173b009d1f
2 changed files with 13 additions and 2 deletions
  1. 11 0
      glm/core/_fixes.hpp
  2. 2 2
      glm/core/func_common.inl

+ 11 - 0
glm/core/_fixes.hpp

@@ -16,3 +16,14 @@
 #ifdef min
 #undef min
 #endif
+
+//! Workaround for Android
+#ifdef isnan
+#undef isnan
+#endif
+
+//! Workaround for Android
+#ifdef isinf
+#undef isinf
+#endif
+

+ 2 - 2
glm/core/func_common.inl

@@ -1211,7 +1211,7 @@ namespace glm
 #if(GLM_COMPILER & GLM_COMPILER_VC)
 		return typename genType::bool_type(_isnan(x));
 #elif(defined(ANDROID))
-		return typename genType::bool_type(isnan(x));
+		return typename genType::bool_type(isnanf(x));
 #else
 		return typename genType::bool_type(std::isnan(x));
 #endif
@@ -1264,7 +1264,7 @@ namespace glm
 #if(GLM_COMPILER & GLM_COMPILER_VC)
 		return typename genType::bool_type(_fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF);
 #elif(defined(ANDROID))
-		return typename genType::bool_type(isinf(x));
+		return typename genType::bool_type(__isinf(x));
 #else
 		return typename genType::bool_type(std::isinf(x));
 #endif