14 out = (in & 0xff) << 24;
15 out |= (in & 0xff00) << 8;
16 out |= (in & 0xff0000) >> 8;
17 out |= (in & 0xff000000) >> 24;
29 out = (in & 0xff) << 8;
30 out |= (in & 0xff00) >> 8;
35#if OSMO_IS_LITTLE_ENDIAN == 1
36#define osmo_ntohl(x) osmo_swab32(x)
37#define osmo_ntohs(x) osmo_swab16(x)
38#define osmo_htonl(x) osmo_swab32(x)
39#define osmo_htons(x) osmo_swab16(x)
41#define osmo_ntohl(x) (x)
42#define osmo_ntohs(x) (x)
43#define osmo_htonl(x) (x)
44#define osmo_htons(x) (x)
static uint32_t osmo_swab32(uint32_t in)
byte-swap a 32bit word
Definition: byteswap.h:10
static uint16_t osmo_swab16(uint16_t in)
byte-swap a 16bit word
Definition: byteswap.h:25
GNU and FreeBSD have various ways to express the endianness but none of them is similar enough.