gallium: add endian detection for OpenBSD
authorJonathan Gray <jsg@jsg.id.au>
Mon, 10 Mar 2014 14:54:43 +0000 (08:54 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 11 Mar 2014 14:47:12 +0000 (08:47 -0600)
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/include/pipe/p_config.h

index d6036818fd844021cbabe3ad65d18f29be7dde4a..b5e773694a5e60bd17ad5e64e1957d56eafb5434 100644 (file)
 # 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)