mirror of
https://github.com/g-truc/glm.git
synced 2024-11-26 10:14:35 +00:00
Fixed isnan and isinf on Android with Clang, issue #54
This commit is contained in:
parent
8ed5f541ff
commit
003c547e43
@ -803,19 +803,19 @@ namespace detail
|
|||||||
{
|
{
|
||||||
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'isnan' only accept floating-point inputs");
|
GLM_STATIC_ASSERT(detail::type<genType>::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;
|
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)
|
# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
|
||||||
return _isnan(x) != 0;
|
return _isnan(x) != 0;
|
||||||
# else
|
# else
|
||||||
return std::isnan(x);
|
return std::isnan(x);
|
||||||
# endif
|
# endif
|
||||||
# elif(GLM_COMPILER & GLM_COMPILER_CUDA)
|
# elif(GLM_COMPILER & GLM_COMPILER_CUDA)
|
||||||
return isnan(x) != 0;
|
return isnan(x) != 0;
|
||||||
# else
|
# else
|
||||||
return std::isnan(x);
|
return std::isnan(x);
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@ -860,35 +860,20 @@ namespace detail
|
|||||||
{
|
{
|
||||||
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'isinf' only accept floating-point inputs");
|
GLM_STATIC_ASSERT(detail::type<genType>::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;
|
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)
|
# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
|
||||||
return _isinf(x) != 0;
|
return _isinf(x) != 0;
|
||||||
# else
|
# else
|
||||||
return std::isinf(x);
|
return std::isinf(x);
|
||||||
# endif
|
# endif
|
||||||
# elif(GLM_COMPILER & GLM_COMPILER_CUDA)
|
# 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
|
// 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;
|
return isinf(double(x)) != 0;
|
||||||
# else
|
# else
|
||||||
return std::isinf(x);
|
return std::isinf(x);
|
||||||
# endif
|
# 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
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -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
|
- Fixed GTX_polar_coordinates euclidean function, takes a vec2 instead of a vec3
|
||||||
- Clarify the license applying on the manual
|
- Clarify the license applying on the manual
|
||||||
- Added a docx copy of 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
|
GLM 0.9.4.2: 2013-02-14
|
||||||
|
Loading…
Reference in New Issue
Block a user