blob: ba2cce4b68aac8021a924b82a24789f8582e274c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
diff --git a/test/gtc/gtc_packing.cpp b/test/gtc/gtc_packing.cpp
index 5830999..86167c5 100644
--- a/test/gtc/gtc_packing.cpp
+++ b/test/gtc/gtc_packing.cpp
@@ -5,6 +5,8 @@
#include <cstdio>
#include <vector>
+#include <endian.h>
+
void print_bits(float const& s)
{
union
@@ -154,6 +156,7 @@ int test_U3x10_1x2()
Error += glm::all(glm::equal(v0, v1)) ? 0 : 1;
}
+#if BYTE_ORDER == LITTLE_ENDIAN
glm::u8vec4 const v0(0xff, 0x77, 0x0, 0x33);
glm::uint32 const p0 = *reinterpret_cast<glm::uint32 const*>(&v0[0]);
glm::uint32 const r0 = 0x330077ff;
@@ -165,7 +168,7 @@ int test_U3x10_1x2()
glm::uint32 const r1 = 0xc001dcff;
Error += p1 == r1 ? 0 : 1;
-
+#endif
return Error;
}
|