Fixed log2 in GCC

This commit is contained in:
Christophe Riccio
2012-01-08 22:36:49 +00:00
parent 8711720b91
commit 1ed0e3865b
3 changed files with 18 additions and 10 deletions

View File

@@ -60,8 +60,10 @@ namespace _detail
template <typename T>
T operator() (T const & Value) const
{
#if(GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_GCC))
#if(GLM_COMPILER & GLM_COMPILER_VC)
return Value <= T(1) ? T(0) : T(32) - nlz(Value - T(1));
#elif(GLM_COMPILER & GLM_COMPILER_GCC)
return Value <= T(1) ? T(0) : nlz(Value - T(1)) + 1;
#else
return T(32) - nlz(Value - T(1));
#endif