/* byteswap.h — byte-order swapping macros. * * Red Bear OS / relibc. Mirrors the glibc interface. The macros * lower to the compiler byte-swap builtins, so they are constant-foldable and * need no runtime symbol. Provided because portable ELF/object tooling * (elfutils/libelf, etc.) uses bswap_16/32/64 directly. */ #ifndef _BYTESWAP_H #define _BYTESWAP_H 1 #include #define bswap_16(x) __builtin_bswap16((uint16_t)(x)) #define bswap_32(x) __builtin_bswap32((uint32_t)(x)) #define bswap_64(x) __builtin_bswap64((uint64_t)(x)) #endif /* byteswap.h */