summaryrefslogtreecommitdiff
path: root/audio/musicpd/patches/patch-src_system_ByteOrder.hxx
blob: 080a1719d8fbb4fb0b4c8244e74c6cb687f0fcd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$NetBSD: patch-src_system_ByteOrder.hxx,v 1.2 2014/08/21 12:14:16 wiz Exp $

<endian.h> is a non-standard header that only Linux provides.

http://bugs.musicpd.org/view.php?id=4060

--- src/system/ByteOrder.hxx.orig	2014-05-15 23:46:49.000000000 +0000
+++ src/system/ByteOrder.hxx
@@ -40,8 +40,18 @@
 /* well-known big-endian */
 #  define IS_LITTLE_ENDIAN false
 #  define IS_BIG_ENDIAN true
+#elif defined(__APPLE__)
+/* generic compile-time check for MacOS */
+#  include <machine/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
 #else
-/* generic compile-time check */
+/* generic compile-time check for Linux */
 #  include <endian.h>
 #  if __BYTE_ORDER == __LITTLE_ENDIAN
 #    define IS_LITTLE_ENDIAN true