From 003c547e437193f0d38ce7aad7e406590eb2dd6f Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 16 Mar 2013 01:34:37 +0100 Subject: [PATCH] Fixed isnan and isinf on Android with Clang, issue #54 --- glm/core/func_common.inl | 37 +++++++++++-------------------------- readme.txt | 3 +++ 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/glm/core/func_common.inl b/glm/core/func_common.inl index f98fd411..17d0a62b 100644 --- a/glm/core/func_common.inl +++ b/glm/core/func_common.inl @@ -803,19 +803,19 @@ namespace detail { GLM_STATIC_ASSERT(detail::type::is_float, "'isnan' only accept floating-point inputs"); -# if(GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_INTEL)) +# if(GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_INTEL)) return _isnan(x) != 0; -# elif(GLM_COMPILER & GLM_COMPILER_GCC) +# elif(GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG)) # if(GLM_PLATFORM & GLM_PLATFORM_ANDROID) return _isnan(x) != 0; # else return std::isnan(x); # endif # elif(GLM_COMPILER & GLM_COMPILER_CUDA) - return isnan(x) != 0; -# else + return isnan(x) != 0; +# else return std::isnan(x); -# endif +# endif } template @@ -860,35 +860,20 @@ namespace detail { GLM_STATIC_ASSERT(detail::type::is_float, "'isinf' only accept floating-point inputs"); -# if(GLM_COMPILER & (GLM_COMPILER_INTEL | GLM_COMPILER_VC)) +# if(GLM_COMPILER & (GLM_COMPILER_INTEL | GLM_COMPILER_VC)) return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; -# elif(GLM_COMPILER & GLM_COMPILER_GCC) +# elif(GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG)) # if(GLM_PLATFORM & GLM_PLATFORM_ANDROID) return _isinf(x) != 0; # else return std::isinf(x); # endif # elif(GLM_COMPILER & GLM_COMPILER_CUDA) - // http://developer.download.nvidia.com/compute/cuda/4_2/rel/toolkit/docs/online/group__CUDA__MATH__DOUBLE_g13431dd2b40b51f9139cbb7f50c18fab.html#g13431dd2b40b51f9139cbb7f50c18fab - return isinf(double(x)) != 0; -# else + // http://developer.download.nvidia.com/compute/cuda/4_2/rel/toolkit/docs/online/group__CUDA__MATH__DOUBLE_g13431dd2b40b51f9139cbb7f50c18fab.html#g13431dd2b40b51f9139cbb7f50c18fab + return isinf(double(x)) != 0; +# else return std::isinf(x); -# endif -/* -# if(GLM_COMPILER & GLM_COMPILER_VC) - return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; -# elif(GLM_COMPILER & GLM_COMPILER_GCC) -# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID) - return _isinf(x) != 0; -# else - return std::isinf(x); -# endif -# elif(GLM_COMPILER & GLM_COMPILER_INTEL) - return isinf(x) != 0; -# else - return std::isinf(x); -# endif -*/ +# endif } template diff --git a/readme.txt b/readme.txt index 4b29441f..81706900 100644 --- a/readme.txt +++ b/readme.txt @@ -45,6 +45,9 @@ GLM 0.9.4.3: 2013-0X-XX - Fixed GTX_polar_coordinates euclidean function, takes a vec2 instead of a vec3 - Clarify the license applying on the manual - Added a docx copy of the manual +- Fixed GLM_GTX_matrix_interpolation +- Fixed isnan and isinf on Android with Clang + ================================================================================ GLM 0.9.4.2: 2013-02-14