From 05208b298d218071bae75a52a16e4483ca64c94d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 20 Jan 2010 08:02:59 -0700 Subject: mesa: replace questionable CPU_TO_LE32 macro with function --- src/mesa/main/compiler.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/mesa/main/compiler.h') diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 9eab1ead24..9cef99f67a 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -223,8 +223,8 @@ extern "C" { /** - * Either define MESA_BIG_ENDIAN or MESA_LITTLE_ENDIAN. - * Do not use them unless absolutely necessary! + * Either define MESA_BIG_ENDIAN or MESA_LITTLE_ENDIAN, and 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. */ @@ -236,10 +236,13 @@ extern "C" { #include #define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x ) #elif (defined(_AIX) || defined(__blrts)) -#define CPU_TO_LE32( x ) x = ((x & 0x000000ff) << 24) | \ - ((x & 0x0000ff00) << 8) | \ - ((x & 0x00ff0000) >> 8) | \ - ((x & 0xff000000) >> 24); +static INLINE GLuint CPU_TO_LE32(GLuint x) +{ + return (((x & 0x000000ff) << 24) | + ((x & 0x0000ff00) << 8) | + ((x & 0x00ff0000) >> 8) | + ((x & 0xff000000) >> 24)); +} #else /*__linux__ */ #include #define CPU_TO_LE32( x ) bswap32( x ) -- cgit v1.2.3