Fixed swizzle error with C++ 98

This commit is contained in:
Christophe Riccio 2018-08-17 01:10:51 +02:00
parent bb98016c33
commit c7822ff6ff
3 changed files with 11 additions and 12 deletions

View file

@ -64,7 +64,7 @@ namespace detail
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (vec<N, T, Q> const& that)
{
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());
return *this;
@ -73,7 +73,7 @@ namespace detail
GLM_FUNC_QUALIFIER void operator -= (vec<N, T, Q> const& that)
{
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());
}
@ -81,7 +81,7 @@ namespace detail
GLM_FUNC_QUALIFIER void operator += (vec<N, T, Q> const& that)
{
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());
}
@ -89,7 +89,7 @@ namespace detail
GLM_FUNC_QUALIFIER void operator *= (vec<N, T, Q> const& that)
{
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());
}
@ -97,7 +97,7 @@ namespace detail
GLM_FUNC_QUALIFIER void operator /= (vec<N, T, Q> const& that)
{
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());
}
@ -115,7 +115,7 @@ namespace detail
protected:
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.
// The copier should optimize out the copy in cases where the function is

View file

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

View file

@ -403,7 +403,7 @@
#elif GLM_COMPILER & GLM_COMPILER_VC
# define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]
#else
# define GLM_STATIC_ASSERT(x, message)
# define GLM_STATIC_ASSERT(x, message) assert(x)
#endif//GLM_LANG
///////////////////////////////////////////////////////////////////////////////////
@ -448,7 +448,7 @@
#define GLM_SWIZZLE_OPERATOR 1
#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
#elif defined(GLM_FORCE_SWIZZLE) && !defined(GLM_FORCE_XYZW_ONLY)
# define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_FUNCTION
@ -755,7 +755,7 @@ namespace detail
///////////////////////////////////////////////////////////////////////////////////
// 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
#else
# define GLM_CONFIG_SIMD GLM_DISABLE