summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJeremy Huddleston <[email protected]>2011-07-31 09:31:48 -0700
committerJeremy Huddleston <[email protected]>2011-07-31 09:43:52 -0700
commit5b3c7199830b8eaac4df2f8c3f10d0e89b4bd5c5 (patch)
tree75037726d4b62649d58b5732bc3123e946c31b71 /src
parente737a99a6fbafe3ba4b5175eea25d1598dbeb9d8 (diff)
darwin: Use machine/endian.h to determine endianness
Signed-off-by: Jeremy Huddleston <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/include/pipe/p_config.h9
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 803b806592c..8a5d892c884 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)