summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-05-29 20:37:14 +0200
committerMax Kellermann <max@musicpd.org>2017-05-29 20:37:14 +0200
commit0a379fc514930a49c4006da1d7a03cb32d535fb5 (patch)
treea4fd57a0fd09b69f047e1716da0019171938bc26 /src
parent445c11b8d976e74c6392e001973ca1ff07806ca6 (diff)
system/ByteOrder: fix byte order detection on FreeBSD/aarch64
Patch from https://svnweb.freebsd.org/ports/head/audio/musicpd/files/patch-src_system_ByteOrder.hxx?revision=441921&view=co (with a tiny modification) Closes #59
Diffstat (limited to 'src')
-rw-r--r--src/system/ByteOrder.hxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/system/ByteOrder.hxx b/src/system/ByteOrder.hxx
index d4cf454c9..edeeb31c3 100644
--- a/src/system/ByteOrder.hxx
+++ b/src/system/ByteOrder.hxx
@@ -52,6 +52,15 @@
# define IS_LITTLE_ENDIAN false
# define IS_BIG_ENDIAN true
# endif
+#elif defined(__BYTE_ORDER__)
+/* GCC-specific macros */
+# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+# define IS_LITTLE_ENDIAN true
+# define IS_BIG_ENDIAN false
+# else
+# define IS_LITTLE_ENDIAN false
+# define IS_BIG_ENDIAN true
+# endif
#else
/* generic compile-time check */
# include <endian.h>