[Mesa-dev] [PATCH] gallium: add endian detection for OpenBSD

Jonathan Gray jsg at jsg.id.au
Wed Aug 14 07:17:27 PDT 2013


Signed-off-by: Jonathan Gray <jsg at jsg.id.au>
---
 src/gallium/include/pipe/p_config.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git src/gallium/include/pipe/p_config.h src/gallium/include/pipe/p_config.h
index 1588a92..9af5df7 100644
--- src/gallium/include/pipe/p_config.h
+++ src/gallium/include/pipe/p_config.h
@@ -153,6 +153,16 @@
 # define PIPE_ARCH_BIG_ENDIAN
 #endif
 
+#elif defined(__OpenBSD__)
+#include <sys/types.h>
+#include <machine/endian.h>
+
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+# define PIPE_ARCH_LITTLE_ENDIAN
+#elif _BYTE_ORDER == _BIG_ENDIAN
+# define PIPE_ARCH_BIG_ENDIAN
+#endif
+
 #else
 
 #if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) || defined(PIPE_ARCH_ARM) || defined(PIPE_ARCH_AARCH64)
-- 
1.8.3.3



More information about the mesa-dev mailing list