Fixed isnan on GCC

This commit is contained in:
Christophe Riccio 2012-09-20 12:28:12 +02:00
parent c6d87a9458
commit 8c4ea6ebb2
2 changed files with 15 additions and 0 deletions

View File

@ -303,6 +303,8 @@ namespace glm
/// floating point representations. Returns false otherwise,
/// including for implementations with no NaN
/// representations.
///
/// /!\ When using compiler fast math, this function may fail.
///
/// @tparam genType Floating-point scalar or vector types.
///

View File

@ -864,6 +864,18 @@ namespace detail
{
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'isinf' only accept floating-point inputs");
# if(GLM_COMPILER & (GLM_COMPILER_INTEL | 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
# 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)
@ -877,6 +889,7 @@ namespace detail
# else
return std::isinf(x);
# endif
*/
}
template <typename T>