mirror of
https://github.com/g-truc/glm.git
synced 2024-11-23 01:14:34 +00:00
Fixed isnan on GCC
This commit is contained in:
parent
c6d87a9458
commit
8c4ea6ebb2
@ -303,6 +303,8 @@ namespace glm
|
|||||||
/// floating point representations. Returns false otherwise,
|
/// floating point representations. Returns false otherwise,
|
||||||
/// including for implementations with no NaN
|
/// including for implementations with no NaN
|
||||||
/// representations.
|
/// representations.
|
||||||
|
///
|
||||||
|
/// /!\ When using compiler fast math, this function may fail.
|
||||||
///
|
///
|
||||||
/// @tparam genType Floating-point scalar or vector types.
|
/// @tparam genType Floating-point scalar or vector types.
|
||||||
///
|
///
|
||||||
|
@ -864,6 +864,18 @@ 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))
|
||||||
|
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)
|
# if(GLM_COMPILER & 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)
|
||||||
@ -877,6 +889,7 @@ namespace detail
|
|||||||
# else
|
# else
|
||||||
return std::isinf(x);
|
return std::isinf(x);
|
||||||
# endif
|
# endif
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
Loading…
Reference in New Issue
Block a user