From c0ee3b22163da1b77fcc7362aa6e0e3a8c6a9f8d Mon Sep 17 00:00:00 2001 From: Richard Allen Date: Tue, 5 Nov 2024 18:44:49 -0600 Subject: [PATCH] AP_HAL: support port SITL to OpenBSD --- libraries/AP_HAL/utility/sparse-endian.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/AP_HAL/utility/sparse-endian.h b/libraries/AP_HAL/utility/sparse-endian.h index f562e1166dca0..2162f034e418a 100644 --- a/libraries/AP_HAL/utility/sparse-endian.h +++ b/libraries/AP_HAL/utility/sparse-endian.h @@ -57,6 +57,12 @@ typedef uint64_t __ap_bitwise be64_t; #undef be64toh #undef le64toh +#if !defined (__BYTE_ORDER) && defined (__OpenBSD__) +#define __BYTE_ORDER __BYTE_ORDER__ +#define __LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__ +#define __BIG_ENDIAN __ORDER_BIG_ENDIAN__ +#endif + #if __BYTE_ORDER == __LITTLE_ENDIAN #define bswap_16_on_le(x) __bswap_16(x) #define bswap_32_on_le(x) __bswap_32(x)