From c7822ff6ff17df1b01a48ace57994157d801a720 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 17 Aug 2018 01:10:51 +0200 Subject: [PATCH] Fixed swizzle error with C++ 98 --- glm/detail/_swizzle.hpp | 12 ++++++------ glm/detail/func_matrix_simd.inl | 5 ++--- glm/detail/setup.hpp | 6 +++--- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/glm/detail/_swizzle.hpp b/glm/detail/_swizzle.hpp index 680e8b39..e3de65f2 100644 --- a/glm/detail/_swizzle.hpp +++ b/glm/detail/_swizzle.hpp @@ -64,7 +64,7 @@ namespace detail GLM_FUNC_QUALIFIER _swizzle_base2& operator= (vec 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 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 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 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 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 - GLM_FUNC_QUALIFIER void _apply_op(vec const& that, U op) + GLM_FUNC_QUALIFIER void _apply_op(vec 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 diff --git a/glm/detail/func_matrix_simd.inl b/glm/detail/func_matrix_simd.inl index d87f75e8..f7337fe7 100644 --- a/glm/detail/func_matrix_simd.inl +++ b/glm/detail/func_matrix_simd.inl @@ -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 struct compute_matrixCompMult<4, 4, float, Q, true> { @@ -26,6 +24,7 @@ namespace detail return Result; } }; +# endif template struct compute_transpose<4, 4, float, Q, true> diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index bfeada54..ac892f38 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -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