Removed floor_log2, comment that isnan and isinf are not working on MinGW

This commit is contained in:
Christophe Riccio 2012-09-18 01:52:16 +02:00
parent c7812d44cf
commit c2eea6da26
4 changed files with 12 additions and 10 deletions

View File

@ -803,6 +803,7 @@ namespace detail
smoothstep(edge0.w, edge1.w, x.w)); smoothstep(edge0.w, edge1.w, x.w));
} }
// TODO: Not working on MinGW...
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER bool isnan(genType const & x) GLM_FUNC_QUALIFIER bool isnan(genType const & x)
{ {
@ -814,12 +815,12 @@ namespace detail
# 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) != 0; return std::isnan(x);
# endif # endif
# elif(GLM_COMPILER & GLM_COMPILER_INTEL) # elif(GLM_COMPILER & GLM_COMPILER_INTEL)
return isnan(x) != 0; return isnan(x) != 0;
# else # else
return std::isnan(x) != 0; return std::isnan(x);
# endif # endif
} }
@ -871,12 +872,12 @@ namespace detail
# 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) != 0; return std::isinf(x);
# endif # endif
# elif(GLM_COMPILER & GLM_COMPILER_INTEL) # elif(GLM_COMPILER & GLM_COMPILER_INTEL)
return isinf(x) != 0; return isinf(x) != 0;
# else # else
return std::isinf(x) != 0; return std::isinf(x);
# endif # endif
} }

View File

@ -71,6 +71,7 @@ namespace _detail
}//namespace _detail }//namespace _detail
// Henry Gordon Dietz: http://aggregate.org/MAGIC/ // Henry Gordon Dietz: http://aggregate.org/MAGIC/
/*
GLM_FUNC_QUALIFIER unsigned int floor_log2(unsigned int x) GLM_FUNC_QUALIFIER unsigned int floor_log2(unsigned int x)
{ {
x |= (x >> 1); x |= (x >> 1);
@ -79,9 +80,9 @@ namespace _detail
x |= (x >> 8); x |= (x >> 8);
x |= (x >> 16); x |= (x >> 16);
return(_detail::ones32(x) - 1); return _detail::ones32(x) >> 1;
} }
*/
// mod // mod
GLM_FUNC_QUALIFIER int mod(int x, int y) GLM_FUNC_QUALIFIER int mod(int x, int y)
{ {

View File

@ -371,7 +371,7 @@ int test_isnan()
Error += true == glm::any(glm::isnan(glm::vec3(0.0f/Zero_f))) ? 0 : 1; Error += true == glm::any(glm::isnan(glm::vec3(0.0f/Zero_f))) ? 0 : 1;
Error += true == glm::any(glm::isnan(glm::vec4(0.0f/Zero_f))) ? 0 : 1; Error += true == glm::any(glm::isnan(glm::vec4(0.0f/Zero_f))) ? 0 : 1;
} }
return Error; return Error;
} }

View File

@ -11,7 +11,7 @@
#include <glm/gtc/epsilon.hpp> #include <glm/gtc/epsilon.hpp>
#include <glm/gtx/integer.hpp> #include <glm/gtx/integer.hpp>
#include <cstdio> #include <cstdio>
/*
int test_floor_log2() int test_floor_log2()
{ {
int Error = 0; int Error = 0;
@ -27,7 +27,7 @@ int test_floor_log2()
return Error; return Error;
} }
*/
int test_log2() int test_log2()
{ {
int Error = 0; int Error = 0;
@ -65,7 +65,7 @@ int main()
int Error = 0; int Error = 0;
Error += test_nlz(); Error += test_nlz();
Error += test_floor_log2(); // Error += test_floor_log2();
Error += test_log2(); Error += test_log2();
return Error; return Error;