Mesa (7.11): darwin: Use machine/endian.h to determine endianness

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Sun Jul 31 16:48:23 UTC 2011


Module: Mesa
Branch: 7.11
Commit: 6c72801c2b0eab1b98491244282b98dbeac5d140
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6c72801c2b0eab1b98491244282b98dbeac5d140

Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sun Jul 31 09:31:48 2011 -0700

darwin: Use machine/endian.h to determine endianness

Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
(cherry picked from commit 5b3c7199830b8eaac4df2f8c3f10d0e89b4bd5c5)

---

 src/gallium/include/pipe/p_config.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h
index 803b806..8a5d892 100644
--- a/src/gallium/include/pipe/p_config.h
+++ b/src/gallium/include/pipe/p_config.h
@@ -120,6 +120,15 @@
 # define PIPE_ARCH_BIG_ENDIAN
 #endif
 
+#elif defined(__APPLE__)
+#include <machine/endian.h>
+
+#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN
+# define PIPE_ARCH_LITTLE_ENDIAN
+#elif __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN
+# define PIPE_ARCH_BIG_ENDIAN
+#endif
+
 #else
 
 #if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)




More information about the mesa-commit mailing list