aboutsummaryrefslogtreecommitdiffstats
path: root/src/system
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-11-23 18:45:02 +0100
committerMax Kellermann <max@duempel.org>2013-11-23 18:45:02 +0100
commit99527051b5751d2ef7c6b593f1beda84d1bcc33f (patch)
tree39b08616c597fc173022164050ed557650c177b5 /src/system
parentbed98303a346dd98e2a239579c032d170440441d (diff)
parent57e0cc54424561499039967aa501c17d4b179019 (diff)
downloadmpd-99527051b5751d2ef7c6b593f1beda84d1bcc33f.tar.gz
mpd-99527051b5751d2ef7c6b593f1beda84d1bcc33f.tar.xz
mpd-99527051b5751d2ef7c6b593f1beda84d1bcc33f.zip
Merge branch 'v0.18.x'
Diffstat (limited to '')
-rw-r--r--src/system/ByteOrder.hxx20
-rw-r--r--src/system/fd_util.h5
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).