Updated static assert

master
Christophe Riccio ago%!(EXTRA string=14 years)
parent 20e52ebdab
commit 2a9bf3951a
  1. 3
      glm/core/func_vector_relational.hpp
  2. 9
      glm/setup.hpp

@ -35,12 +35,13 @@ namespace glm
{
GLM_STATIC_ASSERT(detail::is_vector<vecType<T> >::_YES,
"Invalid template instantiation of 'lessThan', GLM vector types required");
GLM_STATIC_ASSERT(detail::is_bool<T>::_NO,
GLM_STATIC_ASSERT(detail::is_bool<T>::_NO,
"Invalid template instantiation of 'lessThan', GLM vector types required floating-point or integer value types vectors");
typename vecType<bool>::bool_type Result(vecType<bool>::null);
for(typename vecType<bool>::size_type i = 0; i < vecType<bool>::value_size(); ++i)
Result[i] = x[i] < y[i];
return Result;
}

@ -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
///////////////////////////////////////////////////////////////////////////////////////////////////

Loading…
Cancel
Save