aboutsummaryrefslogtreecommitdiffstats
path: root/community/glm/fix-endian-test.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-12-28 17:55:55 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-12-28 17:55:55 +0000
commit5a7e6b2c5738e229983bb88fbcaf3d5450e5508c (patch)
tree1164e458da0e145bd9970d16125656f454ade2da /community/glm/fix-endian-test.patch
parent7c40f0b24259d0c92883fb3e33a7b4c1f77c65b9 (diff)
downloadaports-5a7e6b2c5738e229983bb88fbcaf3d5450e5508c.tar.bz2
aports-5a7e6b2c5738e229983bb88fbcaf3d5450e5508c.tar.xz
community/glm: fix tests on big-endian machines
Diffstat (limited to 'community/glm/fix-endian-test.patch')
-rw-r--r--community/glm/fix-endian-test.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/community/glm/fix-endian-test.patch b/community/glm/fix-endian-test.patch
new file mode 100644
index 0000000000..7ae44dc96c
--- /dev/null
+++ b/community/glm/fix-endian-test.patch
@@ -0,0 +1,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;
+ }
+