diff options
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | src/system/ByteOrder.hxx | 12 |
2 files changed, 12 insertions, 1 deletions
@@ -1,6 +1,7 @@ ver 0.18.5 (20??/??/??) * decoder - fluidsynth: auto-detect by default +* fix ia64, mipsel and other little-endian architectures * fix build failures due to missing includes * fix build failure with static libmpdclient diff --git a/src/system/ByteOrder.hxx b/src/system/ByteOrder.hxx index 2124e92db..8beda61c7 100644 --- a/src/system/ByteOrder.hxx +++ b/src/system/ByteOrder.hxx @@ -36,10 +36,20 @@ /* well-known little-endian */ # define IS_LITTLE_ENDIAN true # define IS_BIG_ENDIAN false -#else +#elif defined(__MIPSEB__) /* well-known big-endian */ # define IS_LITTLE_ENDIAN false # define IS_BIG_ENDIAN true +#else +/* generic compile-time check */ +# include <endian.h> +# if __BYTE_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 #endif static inline constexpr bool |