summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/ALAC/EndianPortable.c8
2 files changed, 13 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 0fc778d..8258d4e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-02-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/ALAC/EndianPortable.c
+ Fall back to compiler's __BYTE_ORDER__ for endian-ness detection.
+
2013-02-06 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* configure.ac src/common.h src/ima_adpcm.c src/ms_adpcm.c src/paf.c
diff --git a/src/ALAC/EndianPortable.c b/src/ALAC/EndianPortable.c
index 3aafb3b..5d17a1b 100644
--- a/src/ALAC/EndianPortable.c
+++ b/src/ALAC/EndianPortable.c
@@ -42,6 +42,14 @@
#define TARGET_RT_LITTLE_ENDIAN 0
#elif defined (TARGET_OS_WIN32)
#define TARGET_RT_LITTLE_ENDIAN 1
+#elif defined (__BYTE_ORDER__)
+
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+#define TARGET_RT_LITTLE_ENDIAN 1
+#else
+#define TARGET_RT_LITTLE_ENDIAN 0
+#endif
+
#endif
uint16_t Swap16NtoB(uint16_t inUInt16)