From 2a9bf3951a84377d078e5cb8301d0edb46abe5da Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Tue, 18 Jan 2011 22:31:06 +0000 Subject: [PATCH] Updated static assert --- glm/core/func_vector_relational.hpp | 3 ++- glm/setup.hpp | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/glm/core/func_vector_relational.hpp b/glm/core/func_vector_relational.hpp index 30e5a601..68e498c8 100644 --- a/glm/core/func_vector_relational.hpp +++ b/glm/core/func_vector_relational.hpp @@ -35,12 +35,13 @@ namespace glm { GLM_STATIC_ASSERT(detail::is_vector >::_YES, "Invalid template instantiation of 'lessThan', GLM vector types required"); - GLM_STATIC_ASSERT(detail::is_bool::_NO, + GLM_STATIC_ASSERT(detail::is_bool::_NO, "Invalid template instantiation of 'lessThan', GLM vector types required floating-point or integer value types vectors"); typename vecType::bool_type Result(vecType::null); for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) Result[i] = x[i] < y[i]; + return Result; } diff --git a/glm/setup.hpp b/glm/setup.hpp index 58ef97e4..6820a8df 100644 --- a/glm/setup.hpp +++ b/glm/setup.hpp @@ -13,7 +13,7 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// // Version -#define GLM_VERSION 90 +#define GLM_VERSION 91 #define GLM_VERSION_MAJOR 0 #define GLM_VERSION_MINOR 9 #define GLM_VERSION_PATCH 1 @@ -376,12 +376,13 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// // Static assert +// TODO: Added static_assert support for G++ when C++0x is used. #if((GLM_COMPILER & GLM_COMPILER_VC && GLM_COMPILER >= GLM_COMPILER_VC2010) || (GLM_COMPILER & GLM_COMPILER_GCC && GLM_COMPILER >= GLM_COMPILER_GCC47)) -#define GLM_STATIC_ASSERT(x, message) static_assert(x, message) +# define GLM_STATIC_ASSERT(x, message) static_assert(x, message) #elif(defined(BOOST_STATIC_ASSERT)) -#define GLM_STATIC_ASSERT(x, message) BOOST_STATIC_ASSERT(x) +# define GLM_STATIC_ASSERT(x, message) BOOST_STATIC_ASSERT(x) #else -#define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1] +# define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1] #endif//GLM_DEPENDENCE ///////////////////////////////////////////////////////////////////////////////////////////////////