It'd be nice to have a command available to ebuild authors which returned the endianness (big or little endian) of the architecture... so we could do something like: if eisbigendian; then CFLAGS="${CFLAGS} -DBIGENDIAN" fi or similar rather than doing a switch statement and trying to remember which arch is which endianness... Reproducible: Always Steps to Reproduce: 1. 2. 3.
if your only need is for .c code then #include <sys/types.h> #if BYTE_ORDER == LITTLE_ENDIAN #warn little ! #endif #if BYTE_ORDER == BIG_ENDIAN #warn big ! #endif