diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 578e95ed..dc4e92c6 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -531,6 +531,10 @@ (GLM_LANG & GLM_LANG_CXX11_FLAG) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC49))) +#define GLM_HAS_TRIVIAL_QUERIES (\ + ((GLM_LANG & GLM_LANG_CXX11_FLAG) && !(GLM_COMPILER & GLM_COMPILER_GCC)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12))) + // OpenMP #ifdef _OPENMP # if GLM_COMPILER & GLM_COMPILER_GCC diff --git a/glm/gtc/round.inl b/glm/gtc/round.inl index a0981764..3297c95b 100644 --- a/glm/gtc/round.inl +++ b/glm/gtc/round.inl @@ -295,8 +295,8 @@ namespace detail if(isPowerOfTwo(value)) return value; - genType const prev = highestBitValue(value); - genType const next = prev << 1; + genIUType const prev = highestBitValue(value); + genIUType const next = prev << 1; return (next - value) < (value - prev) ? next : prev; } diff --git a/test/core/core_type_mat4x4.cpp b/test/core/core_type_mat4x4.cpp index b77efae5..d9396c37 100644 --- a/test/core/core_type_mat4x4.cpp +++ b/test/core/core_type_mat4x4.cpp @@ -188,7 +188,7 @@ int test_ctr() { int Error(0); -#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12) +#if GLM_HAS_TRIVIAL_QUERIES //Error += std::is_trivially_default_constructible::value ? 0 : 1; //Error += std::is_trivially_copy_assignable::value ? 0 : 1; Error += std::is_trivially_copyable::value ? 0 : 1; diff --git a/test/core/core_type_vec1.cpp b/test/core/core_type_vec1.cpp index 3a33cad1..b88e87ee 100644 --- a/test/core/core_type_vec1.cpp +++ b/test/core/core_type_vec1.cpp @@ -44,16 +44,16 @@ int test_vec1_ctor() { int Error = 0; -#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12) -// Error += std::is_trivially_default_constructible::value ? 0 : 1; -// Error += std::is_trivially_copy_assignable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; +# if GLM_HAS_TRIVIAL_QUERIES + // Error += std::is_trivially_default_constructible::value ? 0 : 1; + // Error += std::is_trivially_copy_assignable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_copy_constructible::value ? 0 : 1; -#endif + Error += std::is_copy_constructible::value ? 0 : 1; +# endif /* #if GLM_HAS_INITIALIZER_LISTS diff --git a/test/core/core_type_vec2.cpp b/test/core/core_type_vec2.cpp index f0142786..2ac3da96 100644 --- a/test/core/core_type_vec2.cpp +++ b/test/core/core_type_vec2.cpp @@ -202,16 +202,16 @@ int test_vec2_ctor() { int Error = 0; -#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12) -// Error += std::is_trivially_default_constructible::value ? 0 : 1; -// Error += std::is_trivially_copy_assignable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; +# if GLM_HAS_TRIVIAL_QUERIES + // Error += std::is_trivially_default_constructible::value ? 0 : 1; + // Error += std::is_trivially_copy_assignable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_copy_constructible::value ? 0 : 1; -#endif + Error += std::is_copy_constructible::value ? 0 : 1; +# endif #if GLM_HAS_INITIALIZER_LISTS { diff --git a/test/core/core_type_vec3.cpp b/test/core/core_type_vec3.cpp index 7e49244c..31627a68 100644 --- a/test/core/core_type_vec3.cpp +++ b/test/core/core_type_vec3.cpp @@ -20,16 +20,16 @@ int test_vec3_ctor() { int Error = 0; -#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12) -// Error += std::is_trivially_default_constructible::value ? 0 : 1; -// Error += std::is_trivially_copy_assignable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; +# if GLM_HAS_TRIVIAL_QUERIES + // Error += std::is_trivially_default_constructible::value ? 0 : 1; + // Error += std::is_trivially_copy_assignable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_copy_constructible::value ? 0 : 1; -#endif + Error += std::is_copy_constructible::value ? 0 : 1; +# endif #if (GLM_HAS_INITIALIZER_LISTS) { diff --git a/test/core/core_type_vec4.cpp b/test/core/core_type_vec4.cpp index 9fb11e09..355d91f4 100644 --- a/test/core/core_type_vec4.cpp +++ b/test/core/core_type_vec4.cpp @@ -49,16 +49,16 @@ int test_vec4_ctor() Error += glm::all(glm::equal(A, B)) ? 0 : 1; } -#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12) -// Error += std::is_trivially_default_constructible::value ? 0 : 1; -// Error += std::is_trivially_copy_assignable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; +# if GLM_HAS_TRIVIAL_QUERIES + // Error += std::is_trivially_default_constructible::value ? 0 : 1; + // Error += std::is_trivially_copy_assignable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_copy_constructible::value ? 0 : 1; -#endif + Error += std::is_copy_constructible::value ? 0 : 1; +# endif #if GLM_HAS_INITIALIZER_LISTS { diff --git a/test/gtc/gtc_quaternion.cpp b/test/gtc/gtc_quaternion.cpp index a7d39f19..650c58ae 100644 --- a/test/gtc/gtc_quaternion.cpp +++ b/test/gtc/gtc_quaternion.cpp @@ -273,17 +273,17 @@ int test_quat_ctr() { int Error(0); -#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12) -// Error += std::is_trivially_default_constructible::value ? 0 : 1; -// Error += std::is_trivially_default_constructible::value ? 0 : 1; -// Error += std::is_trivially_copy_assignable::value ? 0 : 1; -// Error += std::is_trivially_copy_assignable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; +# if GLM_HAS_TRIVIAL_QUERIES + // Error += std::is_trivially_default_constructible::value ? 0 : 1; + // Error += std::is_trivially_default_constructible::value ? 0 : 1; + // Error += std::is_trivially_copy_assignable::value ? 0 : 1; + // Error += std::is_trivially_copy_assignable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_copy_constructible::value ? 0 : 1; - Error += std::is_copy_constructible::value ? 0 : 1; -#endif + Error += std::is_copy_constructible::value ? 0 : 1; + Error += std::is_copy_constructible::value ? 0 : 1; +# endif # if GLM_HAS_INITIALIZER_LISTS { diff --git a/test/gtx/gtx_dual_quaternion.cpp b/test/gtx/gtx_dual_quaternion.cpp index 53608aaa..562f7b38 100644 --- a/test/gtx/gtx_dual_quaternion.cpp +++ b/test/gtx/gtx_dual_quaternion.cpp @@ -166,17 +166,17 @@ int test_dual_quat_ctr() { int Error(0); -#if (GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12) -// Error += std::is_trivially_default_constructible::value ? 0 : 1; -// Error += std::is_trivially_default_constructible::value ? 0 : 1; -// Error += std::is_trivially_copy_assignable::value ? 0 : 1; -// Error += std::is_trivially_copy_assignable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; +# if GLM_HAS_TRIVIAL_QUERIES + // Error += std::is_trivially_default_constructible::value ? 0 : 1; + // Error += std::is_trivially_default_constructible::value ? 0 : 1; + // Error += std::is_trivially_copy_assignable::value ? 0 : 1; + // Error += std::is_trivially_copy_assignable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_copy_constructible::value ? 0 : 1; - Error += std::is_copy_constructible::value ? 0 : 1; -#endif + Error += std::is_copy_constructible::value ? 0 : 1; + Error += std::is_copy_constructible::value ? 0 : 1; +# endif return Error; }