From d63aa4ea85ec4c6e37f4710e76e62d0e7fa8e4fc Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 6 Aug 2017 23:43:53 +0200 Subject: [PATCH] Fixed build --- glm/gtc/ulp.hpp | 1 + glm/gtc/ulp.inl | 2 +- test/core/core_func_common.cpp | 16 +++++++++++----- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/glm/gtc/ulp.hpp b/glm/gtc/ulp.hpp index fb07502c..859a2aea 100644 --- a/glm/gtc/ulp.hpp +++ b/glm/gtc/ulp.hpp @@ -17,6 +17,7 @@ #include "../detail/setup.hpp" #include "../detail/precision.hpp" #include "../detail/type_int.hpp" +#include "../detail/compute_vector_relational.hpp" #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) # pragma message("GLM: GLM_GTC_ulp extension included") diff --git a/glm/gtc/ulp.inl b/glm/gtc/ulp.inl index 0ce0a40c..fb6a96cb 100644 --- a/glm/gtc/ulp.inl +++ b/glm/gtc/ulp.inl @@ -81,7 +81,7 @@ namespace detail if((ix>0x7f800000) || // x is nan (iy>0x7f800000)) // y is nan return x+y; - if(detail::compute_equal::call(x, y)) + if(compute_equal::call(x, y)) return y; // x=y, return y if(ix==0) { // x == 0 diff --git a/test/core/core_func_common.cpp b/test/core/core_func_common.cpp index c33f0d89..192fede9 100644 --- a/test/core/core_func_common.cpp +++ b/test/core/core_func_common.cpp @@ -844,14 +844,20 @@ namespace sign return (x >> 31) | ((unsigned)-x >> 31); } - template - GLM_FUNC_QUALIFIER genFIType sign_alu2(genFIType x) + GLM_FUNC_QUALIFIER int sign_alu2(int x) { - GLM_STATIC_ASSERT( - std::numeric_limits::is_signed && std::numeric_limits::is_integer, - "'sign' only accept integer inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_signed && std::numeric_limits::is_integer, "'sign' only accept integer inputs"); + +# if GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable : 4146) //cast truncates constant value +# endif return -((unsigned)x >> 31) | (-(unsigned)x >> 31); + +# if GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif } template