From 6eb2512fabf02b602168835c0e4f299ee02922a9 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Thu, 10 Nov 2022 16:01:35 +0800 Subject: [PATCH] util: Cleanup util/compiler.h Remove MESA_*_ENDIAN Use UTIL_ARCH_*_ENDIAN to define CPU_TO_LE32 Signed-off-by: Yonggang Luo Reviewed-by: Erik Faye-Lund Part-of: --- src/util/compiler.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/util/compiler.h b/src/util/compiler.h index d184ad455af..8759b0e020c 100644 --- a/src/util/compiler.h +++ b/src/util/compiler.h @@ -37,15 +37,15 @@ #include #include "util/macros.h" - +#include "util/u_endian.h" /** - * Either define MESA_BIG_ENDIAN or MESA_LITTLE_ENDIAN, and CPU_TO_LE32. + * Define CPU_TO_LE32 * Do not use these unless absolutely necessary! * Try to use a runtime test instead. * For now, only used by some DRI hardware drivers for color/texel packing. */ -#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN +#if UTIL_ARCH_BIG_ENDIAN #if defined(__linux__) #include #define CPU_TO_LE32( x ) bswap_32( x ) @@ -59,10 +59,8 @@ #include #define CPU_TO_LE32( x ) bswap32( x ) #endif /*__linux__*/ -#define MESA_BIG_ENDIAN 1 #else #define CPU_TO_LE32( x ) ( x ) -#define MESA_LITTLE_ENDIAN 1 #endif #define LE32_TO_CPU( x ) CPU_TO_LE32( x )