From 85ca659a59ae5be6fc0824b0684967ec94727e2a Mon Sep 17 00:00:00 2001 From: toonn Date: Wed, 12 Jun 2024 11:39:35 +0000 Subject: [PATCH] il_endian.h: Fix endian handling Based on https://sourceforge.net/p/resil/tickets/8/, which has also been incorporated in the MacPort for libdevil 1.7.8, https://trac.macports.org/export/154482/trunk/dports/devel/libdevil/files/patch-src-IL-include-il_endian.h.diff, but updated for the header included in release 1.8.0 of libdevil. --- src-IL/include/il_endian.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src-IL/include/il_endian.h b/src-IL/include/il_endian.h index c4e6d86..a3cd57f 100644 --- a/src-IL/include/il_endian.h +++ b/src-IL/include/il_endian.h @@ -23,9 +23,13 @@ extern "C" { #ifndef __BIG_ENDIAN__ #define __BIG_ENDIAN__ 1 #endif +#else +#ifndef __LITTLE_ENDIAN__ +#define __LITTLE_ENDIAN__ 1 +#endif #endif -#if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __BIG_ENDIAN__) \ +#if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) \ || (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)) #undef __LITTLE_ENDIAN__ #define Short(s) iSwapShort(s) -- 2.44.0