about summary refs log tree commit diff
path: root/pkgs/servers/x11/xorg/libpciaccess-apple.patch
blob: a005c03cbbe48418fbea4b1a2c8438c628f9271f (plain) (blame)
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
diff -Naur libpciaccess-0.12.1-orig/src/common_interface.c libpciaccess-0.12.1/src/common_interface.c
--- libpciaccess-0.12.1-orig/src/common_interface.c	2010-07-12 00:32:05.000000000 -0400
+++ libpciaccess-0.12.1/src/common_interface.c	2011-08-29 00:48:17.000000000 -0400
@@ -67,6 +67,22 @@
 # define HTOLE_32(x)   (x)
 #endif /* Solaris */
 
+#elif defined(__APPLE__)
+
+#include <architecture/byte_order.h>
+
+#if __BYTE_ORDER == __BIG_ENDIAN
+# define LETOH_16(x)   OSSwapInt16(x)
+# define HTOLE_16(x)   OSSwapInt16(x)
+# define LETOH_32(x)   OSSwapInt32(x)
+# define HTOLE_32(x)   OSSwapInt32(x)
+#else
+# define LETOH_16(x)   (x)
+# define HTOLE_16(x)   (x)
+# define LETOH_32(x)   (x)
+# define HTOLE_32(x)   (x)
+#endif /* darwin */
+
 #else
 
 #include <sys/endian.h>