From 0a379fc514930a49c4006da1d7a03cb32d535fb5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 29 May 2017 20:37:14 +0200 Subject: [PATCH] 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 --- NEWS | 1 + src/system/ByteOrder.hxx | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/NEWS b/NEWS index e8f0345b9..398685b13 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,5 @@ ver 0.20.9 (not yet released) +* fix byte order detection on FreeBSD/aarch64 ver 0.20.8 (2017/05/19) * output 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