Fixed swizzle error with C++ 98

master
Christophe Riccio ago%!(EXTRA string=7 years)
parent bb98016c33
commit c7822ff6ff
  1. 12
      glm/detail/_swizzle.hpp
  2. 5
      glm/detail/func_matrix_simd.inl
  3. 6
      glm/detail/setup.hpp

@ -64,7 +64,7 @@ namespace detail
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (vec<N, T, Q> const& that) GLM_FUNC_QUALIFIER _swizzle_base2& operator= (vec<N, T, Q> const& that)
{ {
struct op { struct op {
GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e = t; } GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e = t; }
}; };
_apply_op(that, op()); _apply_op(that, op());
return *this; return *this;
@ -73,7 +73,7 @@ namespace detail
GLM_FUNC_QUALIFIER void operator -= (vec<N, T, Q> const& that) GLM_FUNC_QUALIFIER void operator -= (vec<N, T, Q> const& that)
{ {
struct op { struct op {
GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e -= t; } GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e -= t; }
}; };
_apply_op(that, op()); _apply_op(that, op());
} }
@ -81,7 +81,7 @@ namespace detail
GLM_FUNC_QUALIFIER void operator += (vec<N, T, Q> const& that) GLM_FUNC_QUALIFIER void operator += (vec<N, T, Q> const& that)
{ {
struct op { struct op {
GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e += t; } GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e += t; }
}; };
_apply_op(that, op()); _apply_op(that, op());
} }
@ -89,7 +89,7 @@ namespace detail
GLM_FUNC_QUALIFIER void operator *= (vec<N, T, Q> const& that) GLM_FUNC_QUALIFIER void operator *= (vec<N, T, Q> const& that)
{ {
struct op { struct op {
GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e *= t; } GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e *= t; }
}; };
_apply_op(that, op()); _apply_op(that, op());
} }
@ -97,7 +97,7 @@ namespace detail
GLM_FUNC_QUALIFIER void operator /= (vec<N, T, Q> const& that) GLM_FUNC_QUALIFIER void operator /= (vec<N, T, Q> const& that)
{ {
struct op { struct op {
GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e /= t; } GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e /= t; }
}; };
_apply_op(that, op()); _apply_op(that, op());
} }
@ -115,7 +115,7 @@ namespace detail
protected: protected:
template<typename U> template<typename U>
GLM_FUNC_QUALIFIER void _apply_op(vec<N, T, Q> const& that, U op) GLM_FUNC_QUALIFIER void _apply_op(vec<N, T, Q> const& that, const U& op)
{ {
// Make a copy of the data in this == &that. // Make a copy of the data in this == &that.
// The copier should optimize out the copy in cases where the function is // The copier should optimize out the copy in cases where the function is

@ -1,6 +1,3 @@
/// @ref core
/// @file glm/detail/func_matrix_simd.inl
#if GLM_ARCH & GLM_ARCH_SSE2_BIT #if GLM_ARCH & GLM_ARCH_SSE2_BIT
#include "type_mat4x4.hpp" #include "type_mat4x4.hpp"
@ -11,6 +8,7 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
template<qualifier Q> template<qualifier Q>
struct compute_matrixCompMult<4, 4, float, Q, true> struct compute_matrixCompMult<4, 4, float, Q, true>
{ {
@ -26,6 +24,7 @@ namespace detail
return Result; return Result;
} }
}; };
# endif
template<qualifier Q> template<qualifier Q>
struct compute_transpose<4, 4, float, Q, true> struct compute_transpose<4, 4, float, Q, true>

@ -403,7 +403,7 @@
#elif GLM_COMPILER & GLM_COMPILER_VC #elif GLM_COMPILER & GLM_COMPILER_VC
# 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]
#else #else
# define GLM_STATIC_ASSERT(x, message) # define GLM_STATIC_ASSERT(x, message) assert(x)
#endif//GLM_LANG #endif//GLM_LANG
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
@ -448,7 +448,7 @@
#define GLM_SWIZZLE_OPERATOR 1 #define GLM_SWIZZLE_OPERATOR 1
#define GLM_SWIZZLE_FUNCTION 2 #define GLM_SWIZZLE_FUNCTION 2
#if defined(GLM_FORCE_SWIZZLE) && !defined(GLM_FORCE_XYZW_ONLY) && (GLM_LANG & GLM_LANG_CXXMS_FLAG) #if defined(GLM_FORCE_SWIZZLE) && !defined(GLM_FORCE_XYZW_ONLY) && (GLM_LANG & GLM_LANG_CXX11_FLAG) && (GLM_LANG & GLM_LANG_CXXMS_FLAG)
# define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_OPERATOR # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_OPERATOR
#elif defined(GLM_FORCE_SWIZZLE) && !defined(GLM_FORCE_XYZW_ONLY) #elif defined(GLM_FORCE_SWIZZLE) && !defined(GLM_FORCE_XYZW_ONLY)
# define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_FUNCTION # define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_FUNCTION
@ -755,7 +755,7 @@ namespace detail
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// Use SIMD instruction sets // Use SIMD instruction sets
#if (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT) #if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT)
# define GLM_CONFIG_SIMD GLM_ENABLE # define GLM_CONFIG_SIMD GLM_ENABLE
#else #else
# define GLM_CONFIG_SIMD GLM_DISABLE # define GLM_CONFIG_SIMD GLM_DISABLE

Loading…
Cancel
Save