C detect little endian code example Example: c detect endianness #define IS_LITTLE_ENDIAN (*(unsigned char *)&(uint32_t){1})