diff --git a/glm/gtc/random.inl b/glm/gtc/random.inl index e21b1953..d299af2f 100644 --- a/glm/gtc/random.inl +++ b/glm/gtc/random.inl @@ -51,7 +51,7 @@ namespace detail GLM_FUNC_QUALIFIER static tvec1 call() { return tvec1( - std::rand()) % std::numeric_limits::max(); + std::rand() % std::numeric_limits::max()); } }; @@ -61,8 +61,8 @@ namespace detail GLM_FUNC_QUALIFIER static tvec2 call() { return tvec2( - std::rand(), - std::rand()) % std::numeric_limits::max(); + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max()); } }; @@ -72,9 +72,9 @@ namespace detail GLM_FUNC_QUALIFIER static tvec3 call() { return tvec3( - std::rand(), - std::rand(), - std::rand()) % std::numeric_limits::max(); + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max()); } }; @@ -84,10 +84,10 @@ namespace detail GLM_FUNC_QUALIFIER static tvec4 call() { return tvec4( - std::rand(), - std::rand(), - std::rand(), - std::rand()) % std::numeric_limits::max(); + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max()); } }; diff --git a/glm/gtx/hash.hpp b/glm/gtx/hash.hpp index cd44028c..1d9e5572 100644 --- a/glm/gtx/hash.hpp +++ b/glm/gtx/hash.hpp @@ -41,10 +41,6 @@ #pragma once -#if !GLM_HAS_CXX11_STL -# error "GLM_GTX_hash requires C++11 standard library support" -#endif - #include #include "../vec2.hpp" @@ -67,6 +63,10 @@ #include "../mat4x3.hpp" #include "../mat4x4.hpp" +#if !GLM_HAS_CXX11_STL +# error "GLM_GTX_hash requires C++11 standard library support" +#endif + namespace std { template