summaryrefslogtreecommitdiff
path: root/dist/Mesa/src/gallium/include/pipe/p_config.h
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2012-08-17 13:58:22 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2012-08-17 13:58:22 +0000
commit9c5e6654f7fbf2935a87fa3fd8ae47ff1e9a59a0 (patch)
treec90ae6d648f4f56949500d956d67f545612d1220 /dist/Mesa/src/gallium/include/pipe/p_config.h
parentce102378455fdaa6d4037e4c9741d7fea8915117 (diff)
Upate to libGL 7.11.2
Tested by jsg@, matthieu@ and ajacoutot@, ok mattieu@
Diffstat (limited to 'dist/Mesa/src/gallium/include/pipe/p_config.h')
-rw-r--r--dist/Mesa/src/gallium/include/pipe/p_config.h35
1 files changed, 27 insertions, 8 deletions
diff --git a/dist/Mesa/src/gallium/include/pipe/p_config.h b/dist/Mesa/src/gallium/include/pipe/p_config.h
index 74a1fa297..8a5d892c8 100644
--- a/dist/Mesa/src/gallium/include/pipe/p_config.h
+++ b/dist/Mesa/src/gallium/include/pipe/p_config.h
@@ -46,7 +46,7 @@
#ifndef P_CONFIG_H_
#define P_CONFIG_H_
-
+#include <limits.h>
/*
* Compiler
*/
@@ -99,9 +99,9 @@
#endif
#endif
-#if defined(__PPC__)
+#if defined(__ppc__) || defined(__ppc64__) || defined(__PPC__)
#define PIPE_ARCH_PPC
-#if defined(__PPC64__)
+#if defined(__ppc64__) || defined(__PPC64__)
#define PIPE_ARCH_PPC_64
#endif
#endif
@@ -111,16 +111,37 @@
* Endian detection.
*/
+#ifdef __GLIBC__
+#include <endian.h>
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+# define PIPE_ARCH_LITTLE_ENDIAN
+#elif __BYTE_ORDER == __BIG_ENDIAN
+# 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)
#define PIPE_ARCH_LITTLE_ENDIAN
#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64)
#define PIPE_ARCH_BIG_ENDIAN
-#else
-#define PIPE_ARCH_UNKNOWN_ENDIAN
#endif
+#endif
-#if !defined(PIPE_OS_EMBEDDED)
+#if !defined(PIPE_ARCH_LITTLE_ENDIAN) && !defined(PIPE_ARCH_BIG_ENDIAN)
+#error Unknown Endianness
+#endif
/*
* Auto-detect the operating system family.
@@ -208,7 +229,5 @@
#endif
#endif /* PIPE_OS_WINDOWS */
-#endif /* !PIPE_OS_EMBEDDED */
-
#endif /* P_CONFIG_H_ */