Detect endianness when building for RTEMS
This adds endianness detection and byte swap definitions for the RTEMS RTOS. Signed-off-by: Jonas Larsson <ljonas@google.com>
This commit is contained in:
parent
35bb8a9a57
commit
853cfa8738
1 changed files with 9 additions and 0 deletions
|
@ -53,6 +53,15 @@ static inline unsigned int bswap_32(unsigned int v)
|
|||
}
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
#ifdef __rtems__
|
||||
#include <rtems/endian.h>
|
||||
#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 <winsock.h>
|
||||
|
||||
|
|
Loading…
Reference in a new issue