diff options
author | Max Kellermann <max@duempel.org> | 2013-11-23 18:45:02 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-11-23 18:45:02 +0100 |
commit | 99527051b5751d2ef7c6b593f1beda84d1bcc33f (patch) | |
tree | 39b08616c597fc173022164050ed557650c177b5 /src/system | |
parent | bed98303a346dd98e2a239579c032d170440441d (diff) | |
parent | 57e0cc54424561499039967aa501c17d4b179019 (diff) | |
download | mpd-99527051b5751d2ef7c6b593f1beda84d1bcc33f.tar.gz mpd-99527051b5751d2ef7c6b593f1beda84d1bcc33f.tar.xz mpd-99527051b5751d2ef7c6b593f1beda84d1bcc33f.zip |
Merge branch 'v0.18.x'
Diffstat (limited to '')
-rw-r--r-- | src/system/ByteOrder.hxx | 20 | ||||
-rw-r--r-- | src/system/fd_util.h | 5 |
2 files changed, 21 insertions, 4 deletions
diff --git a/src/system/ByteOrder.hxx b/src/system/ByteOrder.hxx index 622003254..8beda61c7 100644 --- a/src/system/ByteOrder.hxx +++ b/src/system/ByteOrder.hxx @@ -33,11 +33,23 @@ #include <stdint.h> #if defined(__i386__) || defined(__x86_64__) || defined(__ARMEL__) -#define IS_LITTLE_ENDIAN true -#define IS_BIG_ENDIAN false +/* well-known little-endian */ +# define IS_LITTLE_ENDIAN true +# define IS_BIG_ENDIAN false +#elif defined(__MIPSEB__) +/* well-known big-endian */ +# define IS_LITTLE_ENDIAN false +# define IS_BIG_ENDIAN true #else -#define IS_LITTLE_ENDIAN false -#define IS_BIG_ENDIAN true +/* 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 diff --git a/src/system/fd_util.h b/src/system/fd_util.h index 9003b1616..b7a9a6dd3 100644 --- a/src/system/fd_util.h +++ b/src/system/fd_util.h @@ -104,6 +104,11 @@ socketpair_cloexec_nonblock(int domain, int type, int protocol, int sv[2]); #endif +#ifdef HAVE_LIBMPDCLIENT +/* Avoid symbol conflict with statically linked libmpdclient */ +#define socket_cloexec_nonblock socket_cloexec_nonblock_noconflict +#endif + /** * Wrapper for socket(), which sets the CLOEXEC and the NONBLOCK flag * (atomically if supported by the OS). |