From 1add3562e33f0234da50e54dda8cfa6dac613125 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 5 Sep 2016 09:52:10 +1000 Subject: gallium/util: move endian detect into a separate file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This just ports the simpler endian detection bits, addrlib sharing wants this outside gallium. Acked-by: Marek Olšák Reviewed-by: Nicolai Hähnle --- src/gallium/include/pipe/p_config.h | 40 ++----------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) (limited to 'src/gallium/include/pipe') diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h index 0b570c7894e..3fa43ed7970 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 - -#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 - -#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 - -#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 -#include - -#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 -- cgit v1.2.3