mirror of
https://github.com/g-truc/glm.git
synced 2024-11-26 18:24:35 +00:00
Added GLM_HAS_TRIVIAL_QUERIES define
This commit is contained in:
parent
0ff773a46a
commit
b90c4c430e
@ -531,6 +531,10 @@
|
|||||||
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \
|
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \
|
||||||
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC49)))
|
((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
|
// OpenMP
|
||||||
#ifdef _OPENMP
|
#ifdef _OPENMP
|
||||||
# if GLM_COMPILER & GLM_COMPILER_GCC
|
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||||
|
@ -295,8 +295,8 @@ namespace detail
|
|||||||
if(isPowerOfTwo(value))
|
if(isPowerOfTwo(value))
|
||||||
return value;
|
return value;
|
||||||
|
|
||||||
genType const prev = highestBitValue(value);
|
genIUType const prev = highestBitValue(value);
|
||||||
genType const next = prev << 1;
|
genIUType const next = prev << 1;
|
||||||
return (next - value) < (value - prev) ? next : prev;
|
return (next - value) < (value - prev) ? next : prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ int test_ctr()
|
|||||||
{
|
{
|
||||||
int Error(0);
|
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<glm::mat4>::value ? 0 : 1;
|
//Error += std::is_trivially_default_constructible<glm::mat4>::value ? 0 : 1;
|
||||||
//Error += std::is_trivially_copy_assignable<glm::mat4>::value ? 0 : 1;
|
//Error += std::is_trivially_copy_assignable<glm::mat4>::value ? 0 : 1;
|
||||||
Error += std::is_trivially_copyable<glm::mat4>::value ? 0 : 1;
|
Error += std::is_trivially_copyable<glm::mat4>::value ? 0 : 1;
|
||||||
|
@ -44,7 +44,7 @@ int test_vec1_ctor()
|
|||||||
{
|
{
|
||||||
int Error = 0;
|
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<glm::vec1>::value ? 0 : 1;
|
// Error += std::is_trivially_default_constructible<glm::vec1>::value ? 0 : 1;
|
||||||
// Error += std::is_trivially_copy_assignable<glm::vec1>::value ? 0 : 1;
|
// Error += std::is_trivially_copy_assignable<glm::vec1>::value ? 0 : 1;
|
||||||
Error += std::is_trivially_copyable<glm::vec1>::value ? 0 : 1;
|
Error += std::is_trivially_copyable<glm::vec1>::value ? 0 : 1;
|
||||||
|
@ -202,7 +202,7 @@ int test_vec2_ctor()
|
|||||||
{
|
{
|
||||||
int Error = 0;
|
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<glm::vec2>::value ? 0 : 1;
|
// Error += std::is_trivially_default_constructible<glm::vec2>::value ? 0 : 1;
|
||||||
// Error += std::is_trivially_copy_assignable<glm::vec2>::value ? 0 : 1;
|
// Error += std::is_trivially_copy_assignable<glm::vec2>::value ? 0 : 1;
|
||||||
Error += std::is_trivially_copyable<glm::vec2>::value ? 0 : 1;
|
Error += std::is_trivially_copyable<glm::vec2>::value ? 0 : 1;
|
||||||
|
@ -20,7 +20,7 @@ int test_vec3_ctor()
|
|||||||
{
|
{
|
||||||
int Error = 0;
|
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<glm::vec3>::value ? 0 : 1;
|
// Error += std::is_trivially_default_constructible<glm::vec3>::value ? 0 : 1;
|
||||||
// Error += std::is_trivially_copy_assignable<glm::vec3>::value ? 0 : 1;
|
// Error += std::is_trivially_copy_assignable<glm::vec3>::value ? 0 : 1;
|
||||||
Error += std::is_trivially_copyable<glm::vec3>::value ? 0 : 1;
|
Error += std::is_trivially_copyable<glm::vec3>::value ? 0 : 1;
|
||||||
|
@ -49,7 +49,7 @@ int test_vec4_ctor()
|
|||||||
Error += glm::all(glm::equal(A, B)) ? 0 : 1;
|
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)
|
# if GLM_HAS_TRIVIAL_QUERIES
|
||||||
// Error += std::is_trivially_default_constructible<glm::vec4>::value ? 0 : 1;
|
// Error += std::is_trivially_default_constructible<glm::vec4>::value ? 0 : 1;
|
||||||
// Error += std::is_trivially_copy_assignable<glm::vec4>::value ? 0 : 1;
|
// Error += std::is_trivially_copy_assignable<glm::vec4>::value ? 0 : 1;
|
||||||
Error += std::is_trivially_copyable<glm::vec4>::value ? 0 : 1;
|
Error += std::is_trivially_copyable<glm::vec4>::value ? 0 : 1;
|
||||||
|
@ -273,7 +273,7 @@ int test_quat_ctr()
|
|||||||
{
|
{
|
||||||
int Error(0);
|
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<glm::quat>::value ? 0 : 1;
|
// Error += std::is_trivially_default_constructible<glm::quat>::value ? 0 : 1;
|
||||||
// Error += std::is_trivially_default_constructible<glm::dquat>::value ? 0 : 1;
|
// Error += std::is_trivially_default_constructible<glm::dquat>::value ? 0 : 1;
|
||||||
// Error += std::is_trivially_copy_assignable<glm::quat>::value ? 0 : 1;
|
// Error += std::is_trivially_copy_assignable<glm::quat>::value ? 0 : 1;
|
||||||
|
@ -166,7 +166,7 @@ int test_dual_quat_ctr()
|
|||||||
{
|
{
|
||||||
int Error(0);
|
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<glm::dualquat>::value ? 0 : 1;
|
// Error += std::is_trivially_default_constructible<glm::dualquat>::value ? 0 : 1;
|
||||||
// Error += std::is_trivially_default_constructible<glm::ddualquat>::value ? 0 : 1;
|
// Error += std::is_trivially_default_constructible<glm::ddualquat>::value ? 0 : 1;
|
||||||
// Error += std::is_trivially_copy_assignable<glm::dualquat>::value ? 0 : 1;
|
// Error += std::is_trivially_copy_assignable<glm::dualquat>::value ? 0 : 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user