From 3dab05dc282b51ee742a6473503a0567b70c697b Mon Sep 17 00:00:00 2001 From: q66 Date: Fri, 28 Oct 2022 18:18:46 +0000 Subject: [PATCH] antimicrox: fix build on big endian --- srcpkgs/antimicrox/patches/endian.patch | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 srcpkgs/antimicrox/patches/endian.patch diff --git a/srcpkgs/antimicrox/patches/endian.patch b/srcpkgs/antimicrox/patches/endian.patch new file mode 100644 index 00000000000..3e0093c90ea --- /dev/null +++ b/srcpkgs/antimicrox/patches/endian.patch @@ -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!"