summaryrefslogtreecommitdiffstats
path: root/src/gallium/include
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-09-05 09:52:10 +1000
committerDave Airlie <airlied@redhat.com>2016-09-06 10:06:24 +1000
commit1add3562e33f0234da50e54dda8cfa6dac613125 (patch)
tree83f0e88f7f50624ac1b218f70bdb8a5284bd0309 /src/gallium/include
parenta86be7b6ad2b9b909202fa0653b96cffb3131137 (diff)
downloadexternal_mesa3d-1add3562e33f0234da50e54dda8cfa6dac613125.zip
external_mesa3d-1add3562e33f0234da50e54dda8cfa6dac613125.tar.gz
external_mesa3d-1add3562e33f0234da50e54dda8cfa6dac613125.tar.bz2
gallium/util: move endian detect into a separate file
This just ports the simpler endian detection bits, addrlib sharing wants this outside gallium. Acked-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Diffstat (limited to 'src/gallium/include')
-rw-r--r--src/gallium/include/pipe/p_config.h40
1 files changed, 2 insertions, 38 deletions
diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h
index 0b570c7..3fa43ed 100644
--- a/src/gallium/include/pipe/p_config.h
+++ b/src/gallium/include/pipe/p_config.h
@@ -126,44 +126,8 @@
* 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
-
-#elif defined(__sun)
-#include <sys/isa_defs.h>
-
-#if defined(_LITTLE_ENDIAN)
-# define PIPE_ARCH_LITTLE_ENDIAN
-#elif defined(_BIG_ENDIAN)
-# define PIPE_ARCH_BIG_ENDIAN
-#endif
-
-#elif defined(__OpenBSD__) || defined(__NetBSD__)
-#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
+#include "util/u_endian.h"
+#if !defined(PIPE_ARCH_LITTLE_ENDIAN) && !defined(PIPE_ARCH_BIG_ENDIAN)
#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) || defined(PIPE_ARCH_ARM) || defined(PIPE_ARCH_AARCH64)
#define PIPE_ARCH_LITTLE_ENDIAN