aboutsummaryrefslogtreecommitdiffstats
path: root/src/system
diff options
context:
space:
mode:
Diffstat (limited to 'src/system')
-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).