From 173b009d1f12f7cfc07b43fa939bc1fae761517d Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Tue, 25 Oct 2011 15:02:11 +0100 Subject: [PATCH] Fixed isnan and isinf on Android --- glm/core/_fixes.hpp | 11 +++++++++++ glm/core/func_common.inl | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/glm/core/_fixes.hpp b/glm/core/_fixes.hpp index ba708003..30b6afe2 100644 --- a/glm/core/_fixes.hpp +++ b/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 + diff --git a/glm/core/func_common.inl b/glm/core/func_common.inl index 3bf1566b..7905c14b 100644 --- a/glm/core/func_common.inl +++ b/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