You can detect endianness at runtime. Grabbed from some random page:
Code:
Uint32 Value32;
Uint8 *VPtr = (Uint8 *)&Value32;
VPtr[0] = VPtr[1] = VPtr[2] = 0; VPtr[3] = 1;
if(Value32 == 1)
printf("I'm big endian\n");
else
printf("I'm little endian\n");