mirror of
https://github.com/icaven/glm.git
synced 2025-12-07 01:06:47 +08:00
Changed the assert to a define so that it removed for CUDA debug compiles
This commit is contained in:
parent
f6ae02c608
commit
a1af57aaac
@ -57,7 +57,8 @@ namespace detail
|
|||||||
size_type i
|
size_type i
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
assert(i < this->length());
|
ASSERT(i < this->length());
|
||||||
|
|
||||||
return this->value[i];
|
return this->value[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,9 +69,7 @@ namespace detail
|
|||||||
size_type i
|
size_type i
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
#if !(GLM_COMPILER & GLM_COMPILER_CUDA)
|
ASSERT(i < this->length());
|
||||||
assert(i < this->length());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return this->value[i];
|
return this->value[i];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,7 +45,7 @@ namespace detail
|
|||||||
size_type i
|
size_type i
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
assert(i < this->length());
|
ASSERT(i < this->length());
|
||||||
return (&x)[i];
|
return (&x)[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ namespace detail
|
|||||||
size_type i
|
size_type i
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
assert(i < this->length());
|
ASSERT(i < this->length());
|
||||||
return (&x)[i];
|
return (&x)[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -88,6 +88,12 @@
|
|||||||
//#include <type_traits>
|
//#include <type_traits>
|
||||||
#include "core/setup.hpp"
|
#include "core/setup.hpp"
|
||||||
|
|
||||||
|
#if (GLM_COMPILER & GLM_COMPILER_CUDA)
|
||||||
|
#define ASSERT(s)
|
||||||
|
#else
|
||||||
|
#define ASSERT(s) assert(s);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_CORE_INCLUDED_DISPLAYED))
|
#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_CORE_INCLUDED_DISPLAYED))
|
||||||
# define GLM_MESSAGE_CORE_INCLUDED_DISPLAYED
|
# define GLM_MESSAGE_CORE_INCLUDED_DISPLAYED
|
||||||
# pragma message("GLM: Core library included")
|
# pragma message("GLM: Core library included")
|
||||||
|
|||||||
@ -49,18 +49,14 @@ namespace detail
|
|||||||
|
|
||||||
GLM_FUNC_QUALIFIER half & tvec2<half>::operator[](tvec2<half>::size_type i)
|
GLM_FUNC_QUALIFIER half & tvec2<half>::operator[](tvec2<half>::size_type i)
|
||||||
{
|
{
|
||||||
#if !(GLM_COMPILER & GLM_COMPILER_CUDA)
|
ASSERT(/*i >= tvec2<half>::size_type(0) && */i < tvec2<half>::value_size());
|
||||||
assert(/*i >= tvec2<half>::size_type(0) && */i < tvec2<half>::value_size());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return (&x)[i];
|
return (&x)[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
GLM_FUNC_QUALIFIER half const & tvec2<half>::operator[](tvec2<half>::size_type i) const
|
GLM_FUNC_QUALIFIER half const & tvec2<half>::operator[](tvec2<half>::size_type i) const
|
||||||
{
|
{
|
||||||
#if !(GLM_COMPILER & GLM_COMPILER_CUDA)
|
ASSERT(/*i >= tvec2<half>::size_type(0) && */i < tvec2<half>::value_size());
|
||||||
assert(/*i >= tvec2<half>::size_type(0) && */i < tvec2<half>::value_size());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return (&x)[i];
|
return (&x)[i];
|
||||||
}
|
}
|
||||||
@ -331,9 +327,7 @@ namespace detail
|
|||||||
tvec3<half>::size_type i
|
tvec3<half>::size_type i
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#if !(GLM_COMPILER & GLM_COMPILER_CUDA)
|
ASSERT(/*i >= tvec3<half>::size_type(0) &&*/ i < tvec3<half>::value_size());
|
||||||
assert(/*i >= tvec3<half>::size_type(0) &&*/ i < tvec3<half>::value_size());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return (&x)[i];
|
return (&x)[i];
|
||||||
}
|
}
|
||||||
@ -343,9 +337,7 @@ namespace detail
|
|||||||
tvec3<half>::size_type i
|
tvec3<half>::size_type i
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
#if !(GLM_COMPILER & GLM_COMPILER_CUDA)
|
ASSERT(/*i >= tvec3<half>::size_type(0) &&*/ i < tvec3<half>::value_size());
|
||||||
assert(/*i >= tvec3<half>::size_type(0) &&*/ i < tvec3<half>::value_size());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return (&x)[i];
|
return (&x)[i];
|
||||||
}
|
}
|
||||||
@ -652,9 +644,7 @@ namespace detail
|
|||||||
tvec4<half>::size_type i
|
tvec4<half>::size_type i
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#if !(GLM_COMPILER & GLM_COMPILER_CUDA)
|
ASSERT(/*i >= tvec4<half>::size_type(0) && */i < tvec4<half>::value_size());
|
||||||
assert(/*i >= tvec4<half>::size_type(0) && */i < tvec4<half>::value_size());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return (&x)[i];
|
return (&x)[i];
|
||||||
}
|
}
|
||||||
@ -664,9 +654,7 @@ namespace detail
|
|||||||
tvec4<half>::size_type i
|
tvec4<half>::size_type i
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
#if !(GLM_COMPILER & GLM_COMPILER_CUDA)
|
ASSERT(/*i >= tvec4<half>::size_type(0) && */i < tvec4<half>::value_size());
|
||||||
assert(/*i >= tvec4<half>::size_type(0) && */i < tvec4<half>::value_size());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return (&x)[i];
|
return (&x)[i];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user