mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
p_config.h: Rely on glibc endianness definitions when available
Suggested by Julien Cristau. Signed-off-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
bd3ce30ee7
commit
5e945863ca
1 changed files with 12 additions and 0 deletions
|
|
@ -111,6 +111,17 @@
|
|||
* 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
|
||||
|
||||
#else
|
||||
|
||||
#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
|
||||
#define PIPE_ARCH_LITTLE_ENDIAN
|
||||
#elif defined(PIPE_ARCH_PPC) || defined(PIPE_ARCH_PPC_64)
|
||||
|
|
@ -119,6 +130,7 @@
|
|||
#define PIPE_ARCH_UNKNOWN_ENDIAN
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(PIPE_OS_EMBEDDED)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue