From 853cfa8738dc36f3aba19188b5b8208b7521cf60 Mon Sep 17 00:00:00 2001 From: Jonas Larsson Date: Thu, 6 Apr 2017 10:21:06 -0700 Subject: [PATCH] Detect endianness when building for RTEMS This adds endianness detection and byte swap definitions for the RTEMS RTOS. Signed-off-by: Jonas Larsson --- src/utils/common.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/utils/common.h b/src/utils/common.h index 8a74c7da5..46e96a65b 100644 --- a/src/utils/common.h +++ b/src/utils/common.h @@ -53,6 +53,15 @@ static inline unsigned int bswap_32(unsigned int v) } #endif /* __APPLE__ */ +#ifdef __rtems__ +#include +#define __BYTE_ORDER BYTE_ORDER +#define __LITTLE_ENDIAN LITTLE_ENDIAN +#define __BIG_ENDIAN BIG_ENDIAN +#define bswap_16 CPU_swap_u16 +#define bswap_32 CPU_swap_u32 +#endif /* __rtems__ */ + #ifdef CONFIG_NATIVE_WINDOWS #include