antimicrox: fix build on big endian
This commit is contained in:
parent
0aa2dc9ae3
commit
3dab05dc28
1 changed files with 20 additions and 0 deletions
20
srcpkgs/antimicrox/patches/endian.patch
Normal file
20
srcpkgs/antimicrox/patches/endian.patch
Normal file
|
@ -0,0 +1,20 @@
|
|||
--- a/src/haptictriggerps5.cpp
|
||||
+++ b/src/haptictriggerps5.cpp
|
||||
@@ -27,7 +27,7 @@ constexpr u16 u16tole(u16 x)
|
||||
{
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
return x;
|
||||
-#elif __BYTE_ORDER == _BIG_ENDIAN
|
||||
+#elif __BYTE_ORDER == __BIG_ENDIAN
|
||||
return ((x << 8) & 0xFF00) | ((x >> 8) & 0x00FF);
|
||||
#else
|
||||
#error "Target machine has unknown endianness!"
|
||||
@@ -38,7 +38,7 @@ constexpr u32 u32tole(u32 x)
|
||||
{
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
return x;
|
||||
-#elif __BYTE_ORDER == _BIG_ENDIAN
|
||||
+#elif __BYTE_ORDER == __BIG_ENDIAN
|
||||
return ((x << 24) & 0xFF000000) | ((x << 8) & 0x00FF0000) | ((x >> 8) & 0x0000FF00) | ((x >> 24) & 0x000000FF);
|
||||
#else
|
||||
#error "Target machine has unknown endianness!"
|
Loading…
Add table
Reference in a new issue