APPLE systems do not have <sys/endian.h>, they have
<architecture/byte_order.h> instead.
Signed-off-by: Shea Levy <[email protected]>
---
 src/common_interface.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/common_interface.c b/src/common_interface.c
index 4af772a..6ede9dd 100644
--- a/src/common_interface.c
+++ b/src/common_interface.c
@@ -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>
-- 
1.7.6


_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to