Remove GLM_HAS_STATIC_ASSERT C++11 workarounds

This commit is contained in:
christophe
2025-10-19 12:01:54 +02:00
committed by Christophe
parent 1da632dddd
commit ab5c4c6ee8
67 changed files with 287 additions and 370 deletions

View File

@@ -950,7 +950,7 @@ namespace sign
template<typename genFIType>
GLM_FUNC_QUALIFIER genFIType sign_if(genFIType x)
{
GLM_STATIC_ASSERT(
static_assert(
std::numeric_limits<genFIType>::is_iec559 ||
(std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer), "'sign' only accept signed inputs");
@@ -972,7 +972,7 @@ namespace sign
template<typename genFIType>
GLM_FUNC_QUALIFIER genFIType sign_alu1(genFIType x)
{
GLM_STATIC_ASSERT(
static_assert(
std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer,
"'sign' only accept integer inputs");
@@ -985,7 +985,7 @@ namespace sign
GLM_FUNC_QUALIFIER int sign_alu2(int x)
{
GLM_STATIC_ASSERT(std::numeric_limits<int>::is_signed && std::numeric_limits<int>::is_integer, "'sign' only accept integer inputs");
static_assert(std::numeric_limits<int>::is_signed && std::numeric_limits<int>::is_integer, "'sign' only accept integer inputs");
# if GLM_COMPILER & GLM_COMPILER_VC
# pragma warning(push)
@@ -1002,7 +1002,7 @@ namespace sign
template<typename genFIType>
GLM_FUNC_QUALIFIER genFIType sign_sub(genFIType x)
{
GLM_STATIC_ASSERT(
static_assert(
std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer,
"'sign' only accept integer inputs");
@@ -1012,7 +1012,7 @@ namespace sign
template<typename genFIType>
GLM_FUNC_QUALIFIER genFIType sign_cmp(genFIType x)
{
GLM_STATIC_ASSERT(
static_assert(
std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer,
"'sign' only accept integer inputs");

View File

@@ -163,7 +163,7 @@ namespace bitfieldReverse
template<glm::length_t L, typename T, glm::qualifier Q>
GLM_FUNC_QUALIFIER glm::vec<L, T, Q> bitfieldReverseLoop(glm::vec<L, T, Q> const& v)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldReverse' only accept integer values");
static_assert(std::numeric_limits<T>::is_integer, "'bitfieldReverse' only accept integer values");
glm::vec<L, T, Q> Result(0);
T const BitSize = static_cast<T>(sizeof(T) * 8);
@@ -567,7 +567,7 @@ namespace findMSB
template<typename genIUType>
static int findMSB_intrinsic(genIUType Value)
{
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
static_assert(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
if(Value == 0)
return -1;
@@ -582,7 +582,7 @@ namespace findMSB
template<typename genIUType>
static int findMSB_avx(genIUType Value)
{
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
static_assert(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
if(Value == 0)
return -1;
@@ -594,7 +594,7 @@ namespace findMSB
template<typename genIUType>
static int findMSB_095(genIUType Value)
{
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
static_assert(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
if(Value == genIUType(0) || Value == genIUType(-1))
return -1;
@@ -618,7 +618,7 @@ namespace findMSB
template<typename genIUType>
static int findMSB_nlz1(genIUType x)
{
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
static_assert(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
if (x == 0)
return -1;
@@ -970,7 +970,7 @@ namespace findLSB
template<typename genIUType>
static int findLSB_intrinsic(genIUType Value)
{
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findLSB' only accept integer values");
static_assert(std::numeric_limits<genIUType>::is_integer, "'findLSB' only accept integer values");
if(Value == 0)
return -1;
@@ -984,7 +984,7 @@ namespace findLSB
template<typename genIUType>
static int findLSB_095(genIUType Value)
{
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findLSB' only accept integer values");
static_assert(std::numeric_limits<genIUType>::is_integer, "'findLSB' only accept integer values");
if(Value == 0)
return -1;
@@ -1397,7 +1397,7 @@ namespace bitCount
template<typename T>
inline int bitCount_if(T v)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitCount' only accept integer values");
static_assert(std::numeric_limits<T>::is_integer, "'bitCount' only accept integer values");
int Count(0);
for(T i = 0, n = static_cast<T>(sizeof(T) * 8); i < n; ++i)
@@ -1411,7 +1411,7 @@ namespace bitCount
template<typename T>
inline int bitCount_vec(T v)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitCount' only accept integer values");
static_assert(std::numeric_limits<T>::is_integer, "'bitCount' only accept integer values");
int Count(0);
for(T i = 0, n = static_cast<T>(sizeof(T) * 8); i < n; ++i)

View File

@@ -1,11 +1,9 @@
#include <glm/ext/matrix_int2x2_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::i8mat2x2) == 4, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i16mat2x2) == 8, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i32mat2x2) == 16, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i64mat2x2) == 32, "int64 size isn't 8 bytes on this platform");
#endif
static_assert(sizeof(glm::i8mat2x2) == 4, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i16mat2x2) == 8, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i32mat2x2) == 16, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i64mat2x2) == 32, "int64 size isn't 8 bytes on this platform");
static int test_comp()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/matrix_int2x3_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::i8mat2x3) == 6, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i16mat2x3) == 12, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i32mat2x3) == 24, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i64mat2x3) == 48, "int64 size isn't 8 bytes on this platform");
#endif
static int test_comp()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/matrix_int2x4_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::i8mat2x4) == 8, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i16mat2x4) == 16, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i32mat2x4) == 32, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i64mat2x4) == 64, "int64 size isn't 8 bytes on this platform");
#endif
static int test_comp()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/matrix_int3x2_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::i8mat3x2) == 6, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i16mat3x2) == 12, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i32mat3x2) == 24, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i64mat3x2) == 48, "int64 size isn't 8 bytes on this platform");
#endif
static int test_comp()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/matrix_int3x3_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::i8mat3x3) == 9, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i16mat3x3) == 18, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i32mat3x3) == 36, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i64mat3x3) == 72, "int64 size isn't 8 bytes on this platform");
#endif
static int test_comp()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/matrix_int3x4_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::i8mat3x4) == 12, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i16mat3x4) == 24, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i32mat3x4) == 48, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i64mat3x4) == 96, "int64 size isn't 8 bytes on this platform");
#endif
static int test_comp()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/matrix_int4x2_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::i8mat4x2) == 8, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i16mat4x2) == 16, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i32mat4x2) == 32, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i64mat4x2) == 64, "int64 size isn't 8 bytes on this platform");
#endif
static int test_comp()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/matrix_int4x3_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::i8mat4x3) == 12, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i16mat4x3) == 24, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i32mat4x3) == 48, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i64mat4x3) == 96, "int64 size isn't 8 bytes on this platform");
#endif
static int test_comp()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/matrix_int4x4_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::i8mat4x4) == 16, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i16mat4x4) == 32, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i32mat4x4) == 64, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i64mat4x4) == 128, "int64 size isn't 8 bytes on this platform");
#endif
static int test_comp()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/matrix_uint2x2_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::u8mat2x2) == 4, "uint8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::u16mat2x2) == 8, "uint16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::u32mat2x2) == 16, "uint32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::u64mat2x2) == 32, "uint64 size isn't 8 bytes on this platform");
#endif
static_assert(sizeof(glm::u8mat2x2) == 4, "uint8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::u16mat2x2) == 8, "uint16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::u32mat2x2) == 16, "uint32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::u64mat2x2) == 32, "uint64 size isn't 8 bytes on this platform");
static int test_comp()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/matrix_uint2x3_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::u8mat2x3) == 6, "uint8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::u16mat2x3) == 12, "uint16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::u32mat2x3) == 24, "uint32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::u64mat2x3) == 48, "uint64 size isn't 8 bytes on this platform");
#endif
static int test_comp()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/matrix_uint2x4_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::u8mat2x4) == 8, "uint8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::u16mat2x4) == 16, "uint16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::u32mat2x4) == 32, "uint32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::u64mat2x4) == 64, "uint64 size isn't 8 bytes on this platform");
#endif
static int test_comp()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/matrix_uint3x2_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::u8mat3x2) == 6, "uint8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::u16mat3x2) == 12, "uint16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::u32mat3x2) == 24, "uint32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::u64mat3x2) == 48, "uint64 size isn't 8 bytes on this platform");
#endif
static int test_comp()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/matrix_uint3x3_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::u8mat3x3) == 9, "uint8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::u16mat3x3) == 18, "uint16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::u32mat3x3) == 36, "uint32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::u64mat3x3) == 72, "uint64 size isn't 8 bytes on this platform");
#endif
static int test_comp()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/matrix_uint3x4_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::u8mat3x4) == 12, "uint8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::u16mat3x4) == 24, "uint16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::u32mat3x4) == 48, "uint32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::u64mat3x4) == 96, "uint64 size isn't 8 bytes on this platform");
#endif
static int test_comp()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/matrix_uint4x2_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::u8mat4x2) == 8, "uint8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::u16mat4x2) == 16, "uint16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::u32mat4x2) == 32, "uint32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::u64mat4x2) == 64, "uint64 size isn't 8 bytes on this platform");
#endif
static int test_comp()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/matrix_uint4x3_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::u8mat4x3) == 12, "uint8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::u16mat4x3) == 24, "uint16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::u32mat4x3) == 48, "uint32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::u64mat4x3) == 96, "uint64 size isn't 8 bytes on this platform");
#endif
static int test_comp()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/matrix_uint4x4_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::u8mat4x4) == 16, "uint8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::u16mat4x4) == 32, "uint16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::u32mat4x4) == 64, "uint32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::u64mat4x4) == 128, "uint64 size isn't 8 bytes on this platform");
#endif
static int test_comp()
{

View File

@@ -1,13 +1,11 @@
#include <glm/ext/scalar_int_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::int8) == 1, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::int16) == 2, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::int32) == 4, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::int64) == 8, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::int16) == sizeof(short), "signed short size isn't 4 bytes on this platform");
static_assert(sizeof(glm::int32) == sizeof(int), "signed int size isn't 4 bytes on this platform");
#endif
static_assert(sizeof(glm::int8) == 1, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::int16) == 2, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::int32) == 4, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::int64) == 8, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::int16) == sizeof(short), "signed short size isn't 4 bytes on this platform");
static_assert(sizeof(glm::int32) == sizeof(int), "signed int size isn't 4 bytes on this platform");
static int test_size()
{

View File

@@ -1,13 +1,11 @@
#include <glm/ext/scalar_uint_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::uint8) == 1, "uint8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::uint16) == 2, "uint16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::uint32) == 4, "uint32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::uint64) == 8, "uint64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::uint16) == sizeof(unsigned short), "unsigned short size isn't 4 bytes on this platform");
static_assert(sizeof(glm::uint32) == sizeof(unsigned int), "unsigned int size isn't 4 bytes on this platform");
#endif
static_assert(sizeof(glm::uint8) == 1, "uint8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::uint16) == 2, "uint16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::uint32) == 4, "uint32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::uint64) == 8, "uint64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::uint16) == sizeof(unsigned short), "unsigned short size isn't 4 bytes on this platform");
static_assert(sizeof(glm::uint32) == sizeof(unsigned int), "unsigned int size isn't 4 bytes on this platform");
static int test_size()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/vector_int1_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::i8vec1) == 1, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i16vec1) == 2, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i32vec1) == 4, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i64vec1) == 8, "int64 size isn't 8 bytes on this platform");
#endif
static_assert(sizeof(glm::i8vec1) == 1, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i16vec1) == 2, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i32vec1) == 4, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i64vec1) == 8, "int64 size isn't 8 bytes on this platform");
static int test_size()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/vector_int2_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::i8vec2) == 2, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i16vec2) == 4, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i32vec2) == 8, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i64vec2) == 16, "int64 size isn't 8 bytes on this platform");
#endif
static_assert(sizeof(glm::i8vec2) == 2, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i16vec2) == 4, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i32vec2) == 8, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i64vec2) == 16, "int64 size isn't 8 bytes on this platform");
static int test_size()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/vector_int3_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::i8vec3) == 3, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i16vec3) == 6, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i32vec3) == 12, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i64vec3) == 24, "int64 size isn't 8 bytes on this platform");
#endif
static_assert(sizeof(glm::i8vec3) == 3, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i16vec3) == 6, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i32vec3) == 12, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i64vec3) == 24, "int64 size isn't 8 bytes on this platform");
static int test_size()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/vector_int4_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::i8vec4) == 4, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i16vec4) == 8, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i32vec4) == 16, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i64vec4) == 32, "int64 size isn't 8 bytes on this platform");
#endif
static int test_size()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/vector_uint1_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::u16vec1) == 2, "uint16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::u32vec1) == 4, "uint32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::u64vec1) == 8, "uint64 size isn't 8 bytes on this platform");
#endif
static_assert(sizeof(glm::u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::u16vec1) == 2, "uint16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::u32vec1) == 4, "uint32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::u64vec1) == 8, "uint64 size isn't 8 bytes on this platform");
static int test_size()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/vector_uint2_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::u8vec2) == 2, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::u16vec2) == 4, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::u32vec2) == 8, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::u64vec2) == 16, "int64 size isn't 8 bytes on this platform");
#endif
static int test_size()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/vector_uint3_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::u8vec3) == 3, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::u16vec3) == 6, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::u32vec3) == 12, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::u64vec3) == 24, "int64 size isn't 8 bytes on this platform");
#endif
static int test_size()
{

View File

@@ -1,11 +1,9 @@
#include <glm/ext/vector_uint4_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::u8vec4) == 4, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::u16vec4) == 8, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::u32vec4) == 16, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::u64vec4) == 32, "int64 size isn't 8 bytes on this platform");
#endif
static int test_size()
{

View File

@@ -10,19 +10,19 @@
#include <glm/ext/vector_relational.hpp>
#include <glm/ext/matrix_relational.hpp>
GLM_STATIC_ASSERT(glm::detail::is_aligned<glm::aligned_lowp>::value, "aligned_lowp is not aligned");
GLM_STATIC_ASSERT(glm::detail::is_aligned<glm::aligned_mediump>::value, "aligned_mediump is not aligned");
GLM_STATIC_ASSERT(glm::detail::is_aligned<glm::aligned_highp>::value, "aligned_highp is not aligned");
GLM_STATIC_ASSERT(!glm::detail::is_aligned<glm::packed_highp>::value, "packed_highp is aligned");
GLM_STATIC_ASSERT(!glm::detail::is_aligned<glm::packed_mediump>::value, "packed_mediump is aligned");
GLM_STATIC_ASSERT(!glm::detail::is_aligned<glm::packed_lowp>::value, "packed_lowp is aligned");
static_assert(glm::detail::is_aligned<glm::aligned_lowp>::value, "aligned_lowp is not aligned");
static_assert(glm::detail::is_aligned<glm::aligned_mediump>::value, "aligned_mediump is not aligned");
static_assert(glm::detail::is_aligned<glm::aligned_highp>::value, "aligned_highp is not aligned");
static_assert(!glm::detail::is_aligned<glm::packed_highp>::value, "packed_highp is aligned");
static_assert(!glm::detail::is_aligned<glm::packed_mediump>::value, "packed_mediump is aligned");
static_assert(!glm::detail::is_aligned<glm::packed_lowp>::value, "packed_lowp is aligned");
struct my_vec4_packed
{
glm::uint32 a;
glm::vec4 b;
};
GLM_STATIC_ASSERT(sizeof(my_vec4_packed) == sizeof(glm::uint32) + sizeof(glm::vec4), "glm::vec4 packed is not correct");
static_assert(sizeof(my_vec4_packed) == sizeof(glm::uint32) + sizeof(glm::vec4), "glm::vec4 packed is not correct");
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push
@@ -34,7 +34,7 @@ struct my_vec4_aligned
glm::uint32 a;
glm::aligned_vec4 b;
};
GLM_STATIC_ASSERT(sizeof(my_vec4_aligned) == sizeof(glm::aligned_vec4) * 2, "glm::vec4 aligned is not correct");
static_assert(sizeof(my_vec4_aligned) == sizeof(glm::aligned_vec4) * 2, "glm::vec4 aligned is not correct");
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic pop
@@ -45,14 +45,14 @@ struct my_dvec4_packed
glm::uint64 a;
glm::dvec4 b;
};
GLM_STATIC_ASSERT(sizeof(my_dvec4_packed) == sizeof(glm::uint64) + sizeof(glm::dvec4), "glm::dvec4 packed is not correct");
static_assert(sizeof(my_dvec4_packed) == sizeof(glm::uint64) + sizeof(glm::dvec4), "glm::dvec4 packed is not correct");
struct my_dvec4_aligned
{
glm::uint64 a;
glm::aligned_dvec4 b;
};
//GLM_STATIC_ASSERT(sizeof(my_dvec4_aligned) == sizeof(glm::aligned_dvec4) * 2, "glm::dvec4 aligned is not correct");
//static_assert(sizeof(my_dvec4_aligned) == sizeof(glm::aligned_dvec4) * 2, "glm::dvec4 aligned is not correct");
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push
@@ -69,7 +69,7 @@ struct my_ivec4_packed
# pragma clang diagnostic pop
#endif
GLM_STATIC_ASSERT(sizeof(my_ivec4_packed) == sizeof(glm::uint32) + sizeof(glm::ivec4), "glm::ivec4 packed is not correct");
static_assert(sizeof(my_ivec4_packed) == sizeof(glm::uint32) + sizeof(glm::ivec4), "glm::ivec4 packed is not correct");
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push
@@ -86,14 +86,14 @@ struct my_ivec4_aligned
# pragma clang diagnostic pop
#endif
GLM_STATIC_ASSERT(sizeof(my_ivec4_aligned) == sizeof(glm::aligned_ivec4) * 2, "glm::ivec4 aligned is not correct");
static_assert(sizeof(my_ivec4_aligned) == sizeof(glm::aligned_ivec4) * 2, "glm::ivec4 aligned is not correct");
struct my_u8vec4_packed
{
glm::uint32 a;
glm::u8vec4 b;
};
GLM_STATIC_ASSERT(sizeof(my_u8vec4_packed) == sizeof(glm::uint32) + sizeof(glm::u8vec4), "glm::u8vec4 packed is not correct");
static_assert(sizeof(my_u8vec4_packed) == sizeof(glm::uint32) + sizeof(glm::u8vec4), "glm::u8vec4 packed is not correct");
static int test_copy_vec4()
{

View File

@@ -7,7 +7,6 @@
# include <omp.h>
#endif
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::lowp_u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::mediump_u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::highp_u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
@@ -143,8 +142,6 @@ static_assert(sizeof(glm::lowp_u64vec4) == 32, "uint64 size isn't 8 bytes on thi
static_assert(sizeof(glm::mediump_u64vec4) == 32, "uint64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::highp_u64vec4) == 32, "uint64 size isn't 8 bytes on this platform");
#endif
static int test_scalar_size()
{
int Error = 0;