diff --git a/src/image.cpp b/src/image.cpp index bc18d3c7c9..26ad9ef076 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -168,8 +168,11 @@ bool Image::isPrintICC(uint16_t type, Exiv2::PrintStructureOption option) { } bool Image::isBigEndianPlatform() { -#if defined(__BYTE_ORDER) -#if __BYTE_ORDER == __BIG_ENDIAN +#ifdef __LITTLE_ENDIAN__ + return false; +#else +#if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ return true; #else return false; @@ -182,9 +185,14 @@ bool Image::isBigEndianPlatform() { return e.c[0] != 0; #endif +#endif } bool Image::isLittleEndianPlatform() { +#ifdef __LITTLE_ENDIAN__ + return true; +#else return !isBigEndianPlatform(); +#endif } uint64_t Image::byteSwap(uint64_t value, bool bSwap) {