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
This commit is contained in:
Max Kellermann 2017-05-29 20:37:14 +02:00
parent 445c11b8d9
commit 0a379fc514
2 changed files with 10 additions and 0 deletions

1
NEWS
View File

@ -1,4 +1,5 @@
ver 0.20.9 (not yet released) ver 0.20.9 (not yet released)
* fix byte order detection on FreeBSD/aarch64
ver 0.20.8 (2017/05/19) ver 0.20.8 (2017/05/19)
* output * output

View File

@ -52,6 +52,15 @@
# define IS_LITTLE_ENDIAN false # define IS_LITTLE_ENDIAN false
# define IS_BIG_ENDIAN true # define IS_BIG_ENDIAN true
# endif # 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 #else
/* generic compile-time check */ /* generic compile-time check */
# include <endian.h> # include <endian.h>