diff options
author | Dave Airlie <[email protected]> | 2016-09-05 09:52:10 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2016-09-06 10:06:24 +1000 |
commit | 1add3562e33f0234da50e54dda8cfa6dac613125 (patch) | |
tree | 83f0e88f7f50624ac1b218f70bdb8a5284bd0309 /src/gallium | |
parent | a86be7b6ad2b9b909202fa0653b96cffb3131137 (diff) |
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 <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/include/pipe/p_config.h | 40 |
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 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 <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 |