Add detection of LITTLE/BIG_ENDIAN for GCC versions that define them. I.e. the Apple builds of Xcode/gcc. (fixes #2762)